(WIP)CKS: reconcile node capacity after live resize - #14223
Draft
andrijapanicsb wants to merge 6 commits into
Draft
andrijapanicsb wants to merge 6 commits into
andrijapanicsb wants to merge 6 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #14223 +/- ##
==========================================
Coverage 19.91% 19.92%
- Complexity 20200 20232 +32
==========================================
Files 6373 6375 +2
Lines 577230 577435 +205
Branches 70696 70750 +54
==========================================
+ Hits 114974 115048 +74
- Misses 449690 449797 +107
- Partials 12566 12590 +24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@ACSHomeBot package G |
Packaging results:
Test packages are available at: |
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 24.84% |
| Branch coverage | 19.07% |
Grade Scale
| Grade | Line Coverage | Meaning |
|---|---|---|
| 🟢 A | ≥ 80% | Excellent - this code sleeps well at night 😴 |
| 🟡 B | 60-79% | Good - almost there, don't stop now 😉 |
| 🟠 C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags 😬 |
| 🔴 D | 20-39% | Marginal - boldly shipping where no test has gone before 🖖 |
| ⛔ F | < 20% | Failing - tests? what tests? 🔥 |
Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Why this follow-up is needed
This draft follows #13226, which removed the CKS restriction that prevented changing node compute offerings while a KVM cluster was running. That work builds on #12975, the KVM live-resize support for fixed service offerings.
The VM resize itself can complete successfully: CloudStack records the new offering and libvirt exposes the additional CPU or RAM. Kubernetes may still be advertising the old values, though. In practice, the missing operator step was to restart
kubeleton the resized node and check that the Node object'scapacityandallocatablehad caught up.#14213 tracks that gap. This PR moves that reconciliation into the CKS offering-change workflow, so a successful scale operation means CloudStack, the guest, and Kubernetes agree on the node resources.
What this PR does
For a CPU-count or RAM increase on a running, Cloud-managed KVM worker or control-plane node, CKS now handles one node at a time:
MemTotal.kubelet, wait for it to become active, then wait for the Kubernetes Node to be Ready again.capacityandallocatablereflect the resized guest.The target-node SSH connection is resolved from its actual port-forwarding rule for isolated/VPC networks, rather than assuming that every node is reachable on port 2222. Direct-access networks use the VM's private address on port 22.
Deliberately not done here
Created,Stopped, cap-only, external-node, and non-KVM paths keep their existing behaviour.Draft / QA notes
The focused reconciler and scale-worker tests pass locally. During the first real QA resize, the new reconciler was present in the management JAR but was not visible to the scale worker: the worker gets dependencies through
ComponentContext, while the reconciler had only been declared in the plugin Spring context. This draft now also registers it as a component, matching the existing CKS helper pattern.The dedicated KVM environment has been prepared with a current public CKS ISO, dynamically scalable SystemVM template, and a running two-vCPU/two-GiB worker. The same resize will be repeated against this commit once management-host access is restored, with before/after Node JSON captured for CPU-only, RAM-only, combined resize, pre-cordoned nodes, and forced kubelet/SSH failures.