| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
CloudStack Kubernetes Service (CKS) never resizes a single node. It resizes whole node groups: all control nodes together, all worker nodes together (and all dedicated etcd nodes, if the cluster has any). Since 4.21 the scale API can give each group its own offering (the nodeofferings option), so a cluster stores its compute offering in two places:
When an operator resizes only the workers or only the control nodes, CloudStack updates that group's offering but never updates the cluster-wide one. From then on the cluster-wide offering is out of date: it still shows whatever was set when the cluster was created or last resized as a whole, and no longer matches anything the nodes actually run.
Every scaleKubernetesCluster request that does not name an offering is then treated as "move all nodes to the cluster-wide offering". That includes:
So on a cluster where the workers or the control nodes were ever resized on their own, CloudStack first resizes all existing nodes, control nodes included, to the old offering and records it as the worker offering, and only then adds the new worker, at the old size. The operator (or the autoscaler, unattended) asked for one more worker and got a resize of the whole cluster. If the old offering is smaller than what the nodes run now, the request is most likely refused instead, so the cluster cannot be scaled out at all.
What should happen: a request without an offering changes no node's size, and new workers use the cluster's current worker offering, i.e. the size the existing workers were last scaled to. If the cluster-wide offering happens to be up to date (for example right after a cluster-wide resize), this is exactly what happens today.
A second, smaller problem shows up when enabling autoscaling: the setting is not saved correctly. The cluster-autoscaler is deployed and running, but CloudStack still records autoscaling as off, so a later autoscalingenabled=false does nothing and the autoscaler has to be removed by hand.
The CloudStack UI is not affected: once a cluster has per-group offerings, its Scale dialog pre-fills the worker and control offering fields with their current values and sends them as nodeofferings, so the out-of-date cluster-wide offering is never used. The problem hits requests that name no offering: API and cmk calls, automation, and — most importantly — the cluster-autoscaler, which scales up with size=N only.
Observed for 3a) during QA of #14223; 3b) follows the same code path (traced below). Manual scale-out with size=N was also tested in that QA run and behaved correctly, but only while the cluster-wide offering was up to date.
Found during functional testing of #14223 (CKS live-resize capacity reconciliation) on a 2 management server + 2 KVM host lab, Kubernetes 1.33.1. The code paths above are unchanged on main (checked at af9764b); #14223 does not touch them.
| Back | FazBrowse Home | New Git URL |
Activity