mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
A worker pool rolled out with maxSurge set to its maxReplicas, so CAPI
could create up to maxReplicas replacement VMs before draining any old
one. A pool running 8 workers under a ceiling of 10 could reach 18 VMs
at the peak of an instance type, image or version change.
Those extra VMs run in the tenant's namespace. Today the namespace
ResourceQuota counts them, so a tenant near its quota sees replacement
launchers refused and the rollout stall. Under quotas as reservation
limits, where a pool reserves maxReplicas workers and the namespace
quota goes away, the surge is capacity the platform lends for the
length of a rollout: rollouts are mostly platform-driven, and counting
them against the tenant would block a platform upgrade for any tenant
whose pool sits at its ceiling. That loan has to be bounded, and with
a surge tied to maxReplicas it was as large as the pool itself.
The surge is now one Machine whatever the pool's size. It stays out of
the values: tenants write them, and would then size the platform's
margin. maxUnavailable is unchanged, so a node is still only drained
once its replacement is up; a large pool now rolls one worker at a
time.
Tested with helm unittest on kubernetes-nodes, with the golden renders
updated for the new surge.
Refs: cozystack/community#48
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit fffbb97ac9)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
How to test packages local
cd packages/core/installer
make image-cozystack REGISTRY=YOUR_CUSTOM_REGISTRY
make apply
kubectl delete po -l app=source-controller -n cozy-fluxcd