ExitRolling Deployment: controlling safe batch progression1 / 9
Explanation

A batch needs both a capacity budget and room to start

How capacity limits, readiness gates, and mixed-version compatibility govern batch progression and recovery in VM and container fleets. · advanced

A rolling deployment changes a serving fleet in successive batches. Its safe batch size is bounded by two different budgets: how much healthy capacity may be removed, and how much replacement capacity may be added. With ten healthy units, a healthy floor of eight permits removing two; a total ceiling of twelve permits starting two before removing anything. These are permissions, not guarantees: the remaining fleet must still handle demand, including uneven load across failure domains.

For an ECS rolling service, the healthy floor is ceil(desiredCount × minimumHealthyPercent / 100); the deployment ceiling is floor(desiredCount × maximumPercent / 100). If neither stopping an old task nor starting a replacement is permitted, progression stalls. Pending work, insufficient compute, unavailable IP addresses, or placement constraints can prevent startup even when the configured ceiling allows it.

Surge capacity preserves serving capacity at the cost of temporary resources; removing old units first saves headroom but consumes the availability budget. Kubernetes Deployments express these controls as maxUnavailable and maxSurge. Their percentage rounding differs from ECS, and terminating pods can temporarily increase actual resource consumption beyond replicas plus surge.

ControllerAvailability controlExtra-capacity controlCapacity being changed
ECS rolling serviceminimumHealthyPercentmaximumPercentService tasks
Kubernetes DeploymentmaxUnavailablemaxSurgeDeployment pods
EC2 instance refreshMinimum healthy percentageMaximum healthy percentageAuto Scaling instances