diff --git a/packages/apps/kubernetes-nodes/templates/nodegroup.yaml b/packages/apps/kubernetes-nodes/templates/nodegroup.yaml index 5bf3eaa51..2b6e20808 100644 --- a/packages/apps/kubernetes-nodes/templates/nodegroup.yaml +++ b/packages/apps/kubernetes-nodes/templates/nodegroup.yaml @@ -1044,15 +1044,21 @@ spec: joined. A pool with passed-through GPUs keeps 1: its replacement VM may need the very GPU the old node holds, and would wait for it forever. A Proxmox template's GPU is invisible here, hence the - maxUnavailable override. CAPI refuses maxSurge and maxUnavailable both - at 0, and maxReplicas may be 0, hence the floor of 1. */}} + maxUnavailable override. + maxSurge is one Machine whatever the pool's size. A tenant's quota + reserves maxReplicas workers, and the surge runs on top of whatever + the pool runs, so it is capacity the platform lends during a rollout; + a fixed surge bounds that loan to one worker per pool. It is not a + value because tenants write the values, and would then size the + platform's margin themselves. CAPI refuses maxSurge and + maxUnavailable both at 0, so it cannot be 0 either. */}} {{- $maxUnavailable := ternary 1 0 (not (empty $group.gpus)) }} {{- if not (kindIs "invalid" $.Values.maxUnavailable) }} {{- $maxUnavailable = $.Values.maxUnavailable | int }} {{- end }} strategy: rollingUpdate: - maxSurge: {{ max 1 ($group.maxReplicas | int) }} + maxSurge: 1 maxUnavailable: {{ $maxUnavailable }} type: RollingUpdate selector: diff --git a/packages/apps/kubernetes-nodes/tests/__snapshot__/render_snapshot_test.yaml.snap b/packages/apps/kubernetes-nodes/tests/__snapshot__/render_snapshot_test.yaml.snap index c8e990a9c..58902e32f 100644 --- a/packages/apps/kubernetes-nodes/tests/__snapshot__/render_snapshot_test.yaml.snap +++ b/packages/apps/kubernetes-nodes/tests/__snapshot__/render_snapshot_test.yaml.snap @@ -96,7 +96,7 @@ matches the golden render of a GPU pool: cluster.x-k8s.io/deployment-name: kubernetes-myk8s-md0 strategy: rollingUpdate: - maxSurge: 3 + maxSurge: 1 maxUnavailable: 1 type: RollingUpdate template: @@ -249,7 +249,7 @@ matches the golden render of a kubelet-override pool: cluster.x-k8s.io/deployment-name: kubernetes-myk8s-md0 strategy: rollingUpdate: - maxSurge: 3 + maxSurge: 1 maxUnavailable: 0 type: RollingUpdate template: @@ -404,7 +404,7 @@ matches the golden render of the pool objects: cluster.x-k8s.io/deployment-name: kubernetes-myk8s-md0 strategy: rollingUpdate: - maxSurge: 3 + maxSurge: 1 maxUnavailable: 0 type: RollingUpdate template: diff --git a/packages/apps/kubernetes-nodes/tests/rollout_strategy_test.yaml b/packages/apps/kubernetes-nodes/tests/rollout_strategy_test.yaml index 17e732d33..105e37e02 100644 --- a/packages/apps/kubernetes-nodes/tests/rollout_strategy_test.yaml +++ b/packages/apps/kubernetes-nodes/tests/rollout_strategy_test.yaml @@ -36,8 +36,11 @@ tests: path: spec.strategy.rollingUpdate.maxSurge value: 1 - - it: surges up to the pool ceiling + # The tenant's quota reserves maxReplicas workers; the surge runs on top + # of them, so it is bounded to one worker whatever the pool's size. + - it: surges one worker at a time whatever the pool ceiling set: + minReplicas: 5 maxReplicas: 5 documentSelector: path: kind @@ -45,7 +48,7 @@ tests: asserts: - equal: path: spec.strategy.rollingUpdate.maxSurge - value: 5 + value: 1 - equal: path: spec.strategy.rollingUpdate.maxUnavailable value: 0