Skip to content

CKS: preserve node offerings during nodeids scale-in - #14459

Open
andrijapanicsb wants to merge 1 commit into
mainfrom
cks-nodeids-scale-in-preserve-offerings
Open

andrijapanicsb wants to merge 1 commit into
mainfrom
cks-nodeids-scale-in-preserve-offerings

Conversation

@andrijapanicsb

@andrijapanicsb andrijapanicsb commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #14458. Found during QA for #14223; this is a separate PR based on main.

Fix

A nodeids-only scale-in could fall back to the old global offering and try to resize unrelated nodes before removing the selected worker.

Omitted offering parameters now preserve existing offerings. Count-only accounting uses the node-type offering, and autoscaling-only requests still work without resizing VMs. The normal drain/remove workflow is unchanged.

Testing

137 CKS unit tests passed, including regression tests for selected-worker removal, mixed/legacy offerings and autoscaling-only requests.

Live verification used the #14223 baseline with this fix applied. A request with only the cluster ID and nodeids removed the exact additional worker:

Node Before After
Original control 3 CPU / 3072 MiB Unchanged, same offering
Original worker 3 CPU / 4096 MiB Unchanged, same offering
Selected additional worker 3 CPU / 4096 MiB Removed from CloudStack and Kubernetes

Retained nodes stayed Ready with unchanged guest/Kubernetes capacity, allocatable resources, boot IDs and kubelet start times. All 17 resident Pod UIDs/restart counts were unchanged; HTTP/DNS passed. Repeating the removed ID was rejected without changes.

Final cluster: 6 CPU / 7168 MiB. Global RAM returned to 9/~14 GiB after a 13-GiB test peak. Original node placement was restored.

Do not infer a global resize when offering parameters are omitted. Keep node-type offerings in count-only accounting and continue processing explicit autoscaling changes without a resize. Add regression coverage for selected-worker removal, mixed and legacy offerings, and autoscaling-only requests.

Fixes #14458
@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.46%. Comparing base (c76c01e) to head (3ecf191).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...er/actionworkers/KubernetesClusterScaleWorker.java 25.00% 1 Missing and 2 partials ⚠️
...bernetes/cluster/KubernetesClusterManagerImpl.java 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #14459      +/-   ##
============================================
+ Coverage     20.45%   20.46%   +0.01%     
- Complexity    21417    21439      +22     
============================================
  Files          6487     6487              
  Lines        589329   589328       -1     
  Branches      72246    72247       +1     
============================================
+ Hits         120554   120615      +61     
+ Misses       455642   455547      -95     
- Partials      13133    13166      +33     
Flag Coverage Δ
uitests 3.70% <ø> (ø)
unittests 21.77% <50.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@andrijapanicsb
andrijapanicsb marked this pull request as ready for review October 21, 2026 20:36
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

🔴 Test Coverage Grade: D — Marginal

Metric Value
Line coverage 25.51%
Branch coverage 19.83%

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

@andrijapanicsb andrijapanicsb added this to the 24.0 milestone Oct 21, 2026
@andrijapanicsb
andrijapanicsb requested review from Pearl1594 and nvazquez and removed request for Pearl1594 October 21, 2026 23:39
@andrijapanicsb

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@andrijapanicsb a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19661

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CKS: nodeids scale-in can resize unrelated nodes to the legacy cluster offering

2 participants