bhouse-nexthop opened a new pull request, #14823:
URL: https://github.com/apache/cloudstack/pull/14823
### Description
This PR keeps a CKS cluster's `serviceofferingid` in step with its per node
type offerings.
A scale with `nodeofferings` stores the new control/worker/etcd offering but
never touches `service_offering_id`, so `listKubernetesClusters` and the UI
keep showing an offering no node runs any more.
| When a scale stores the cluster | Cluster offering |
|---|---|
| every node type with nodes is on the same offering | set to that offering |
| node types on different offerings | left as is |
Why "left as is" when they differ:
- a node type with no offering of its own still falls back to the cluster
offering (VM deployment, scale accounting), so changing it there would silently
change that type's offering;
- in that case the cluster offering is still what some nodes run, so it is
not stale.
Notes:
- Node types with no nodes (e.g. no dedicated etcd) are ignored.
- A cluster that already drifted is fixed by its next scale that changes a
size, an offering or autoscaling.
- The autoscale step now keeps the cluster it stored, so an offering step in
the same request no longer writes back the old autoscale settings.
- The cluster offering only changes to the one every node already runs, so
anything that falls back to it (deployment, scale accounting) gets the same
answer as before or a more accurate one.
- No UI or schema change.
- Related open PRs in the same code: #14806 and #14808. This merges cleanly
with both and their tests pass together.
Fixes: #14822
Related: #14702 (this covers the case where all node types end up on one
offering; the mixed case is left as is, see above)
### 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
- [ ] Major
- [x] Minor
- [ ] Trivial
### How Has This Been Tested?
- New unit tests:
- `KubernetesClusterUtilTest`: common offering found / not found, fallback
to the cluster offering, etcd without nodes, no offering anywhere
- `KubernetesClusterResourceModifierActionWorkerTest`: sync sets the
offering, keeps it when node offerings differ, no write when already in sync,
and a per type write through `updateKubernetesClusterEntry` triggers it
- `KubernetesClusterUtilTest`,
`KubernetesClusterResourceModifierActionWorkerTest`,
`KubernetesClusterScaleWorkerTest`, `KubernetesClusterManagerImplTest`,
`KubernetesClusterActionWorkerTest` pass, also with #14806 and #14808 merged in.
#### How did you try to break this feature and the system with this change?
- Legacy cluster (no per type offerings): every type falls back to the
cluster offering, nothing changes.
- Only workers scaled: control still on the cluster offering, so it stays.
- Control scaled first, then workers in the same request: no change after
the first step, synced after the second.
--
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]