fix(kubernetes-nodes): scale a pool capped at zero down to zero

The chart leaves spec.replicas out of the MachineDeployment so the
autoscaler owns it, and relies on CAPI to clamp the live value into
[min, max]. A pool set to maxReplicas 0 to pause it kept its running
workers: the clamp did not bring the MachineDeployment down, and the
autoscaler only removes nodes it finds unneeded. Seen on a managed
cluster suspended for lack of funds, and with Stop group in the
console, both of which set the pool to min 0 / max 0.

A pool capped at zero now renders replicas: 0. Raising maxReplicas
drops the field again, and the autoscaler brings the pool back to its
minimum.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This commit is contained in:
Andrei Kvapil committed 2026-12-01 17:47:05 +01:00
1 parent ce04ec3fb8
commit 4e62068763
7 files changed
+29 -5

No files matched your search

+1 -1
View File
@@ -37,7 +37,7 @@ type ConfigSpec struct {
// Minimum number of replicas in this pool. Used as the cluster-autoscaler floor.
// +kubebuilder:default:=0
MinReplicas int `json:"minReplicas"`
// Maximum number of replicas in this pool. Used as the cluster-autoscaler ceiling.
// Maximum number of replicas in this pool. Used as the cluster-autoscaler ceiling. 0 pauses the pool: its workers are scaled down to zero.
// +kubebuilder:default:=10
MaxReplicas int `json:"maxReplicas"`
// KubeVirt instance type that sizes each worker VM when `resources` is not set. Ignored when `resources.cpu` and `resources.memory` are both set, and therefore on `substrate: proxmox`, which requires them.