neondatabase / autoscaling

Postgres vertical autoscaling in k8s
Apache License 2.0
164 stars 21 forks source link

neonvm-controller: add spec.cpuScalingMode #1104

Closed mikhail-sakhnov closed 1 month ago

mikhail-sakhnov commented 1 month ago

Add the new field to the VirtualMachine spec, and change the VM-controller to explicitly update a VM with the default value of the field. Add temporary e2e test to ensure that VM without spec.cpuScalingMode is updated as expected.

Part of the preparations for #1082

mikhail-sakhnov commented 1 month ago

@sharnoff this PR is required for #1111, but we first need to have a controller version in place that overwrites current VM instances to have defaulted at the time value (qmp based scaling), as we discussed so we could enable sysfs-based scaling only for new instances when we start rolling it out. I think that aligns well with what we discussed last week about the way to update CRDs?

github-actions[bot] commented 1 month ago

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ :robot:
github.com/neondatabase/autoscaling/neonvm/apis/neonvm/v1 0.56% (-0.00%) :thumbsdown:
github.com/neondatabase/autoscaling/pkg/neonvm/controllers 11.73% (+0.22%) :thumbsup:

Coverage by file ### Changed files (no unit tests) | Changed File | Coverage Δ | Total | Covered | Missed | :robot: | |--------------|------------|-------|---------|--------|---------| | github.com/neondatabase/autoscaling/neonvm/apis/neonvm/v1/virtualmachine_types.go | 1.92% (ø) | 52 | 1 | 51 | | | github.com/neondatabase/autoscaling/neonvm/apis/neonvm/v1/zz_generated.deepcopy.go | 0.00% (ø) | 427 (+4) | 0 | 427 (+4) | | | github.com/neondatabase/autoscaling/pkg/neonvm/controllers/vm_controller.go | 25.60% (**+0.37%**) | 668 (+6) | 171 (+4) | 497 (+2) | :thumbsup: | _Please note that the "Total", "Covered", and "Missed" counts above refer to ***code statements*** instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code._ ### Changed unit test files - github.com/neondatabase/autoscaling/pkg/neonvm/controllers/vm_controller_unit_test.go

HTML Report

Click to open

mikhail-sakhnov commented 1 month ago

close in favor of #1111, which already has the changes for the current PR