bhouse-nexthop opened a new pull request, #14837:
URL: https://github.com/apache/cloudstack/pull/14837
### Description
A CKS cluster's `size` includes nodes added with
`addNodesToKubernetesCluster`, but scale-down only counted CKS-created workers.
With added nodes present, scale-down removed too few nodes or none ("No nodes
to remove"), still saved the new size, and a later scale-up waited until
timeout for a Ready count that could not match.
| Change | Why |
|---|---|
| Scale-down by size removes CKS-created workers until created + added =
requested size | was ignoring added nodes |
| ...and never more than the requested drop | clusters whose size already
drifted don't lose extra VMs |
| Reject a size below the number of added nodes (API check, plus a worker
check) | scaling never removes added nodes |
| Reject added nodes in scale `nodeids` | they were skipped but still
subtracted from size; `removeNodesFromKubernetesCluster` handles them |
| UI: no per-node delete button on added nodes | it called scale `nodeids`;
the cluster's remove-nodes action covers them |
| `size` parameter doc says it counts added nodes | |
Scale-up was already right when the stored size matches the nodes: it
creates `size - nodeCount` VMs and waits for `control + size` Ready nodes,
which is the real total. This change stops the size from drifting.
Fixes #14836
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] Build/CI
- [ ] Test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [x] Major
- [ ] Minor
- [ ] Trivial
### How Has This Been Tested?
| Test | Result |
|---|---|
| New unit tests: scale-down with added nodes (6 to 5, 6 to 2), drifted
size, below added count, scale-up with added nodes; API checks for size and
`nodeids` | pass, and the down-scale ones fail without the fix |
| `kubernetes-service` module unit tests | 87 pass |
| Lab (before fix): 1 control + 4 created + 2 added, scale 6 to 5 | job OK,
"No nodes to remove", 6 workers left, size 5; next scale-up stuck in Scaling on
the Ready count |
#### How did you try to break this feature and the system with this change?
- Size equal to the added-node count: removes all CKS-created workers,
allowed (same as the `nodeids` path).
- Stored size already lower than the real nodes: removes at most the
requested drop.
- Test-merged with #14806, #14808, #14829 and #14823: only a test-file
conflict with #14808 (both append tests), all module tests pass.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]