An update must preserve enough ready capacity
Old and new ReplicaSets
Changing a Deployment's Pod template creates a new revision. The controller scales up the new ReplicaSet and scales down the old one. Old and new Pods coexist for a while.
Two constraints
maxSurge allows extra Pods above the desired count. maxUnavailable allows temporarily missing available replicas. These parameters define permitted bounds, not an exact timer for a real controller.
The cost of spare capacity
With three ready Pods at 200 operations/s each, traffic of 600 uses all available capacity. Removing one replica reduces capacity to 400. One extra Pod lets you prepare a replacement before removing an old one.
A version that is not ready
The new version must pass readiness. A startup failure can stall a rollout even when resources are sufficient. In the model, the version is healthy and each wave waits a fixed time; we compare availability and update completion.
Task
Serving 600 operations/s requires three ready Pods. Starting at second 21, update all replicas using maxSurge and maxUnavailable within a budget of 100 units.
The update starts at 21 s. A wave contains up to maxSurge + maxUnavailable new Pods. Up to maxUnavailable old replicas can be removed before their replacements are ready. Each wave takes startup seconds to become ready. The resource upper bound is counted; this simplifies the Deployment controller.
- Add a Deployment.
- Allow an extra replica without reducing readiness.
- Check update completion and losses over the entire interval.