Problem
Stopping every instance and starting new ones causes downtime, while duplicating the whole fleet for a switchover is expensive. A release process is needed that keeps the service up using roughly the capacity already provisioned.
Also known as: rolling-deployment, rolling-upgrade
Replace instances of a service gradually in small batches so capacity and availability are maintained throughout the release.
Stopping every instance and starting new ones causes downtime, while duplicating the whole fleet for a switchover is expensive. A release process is needed that keeps the service up using roughly the capacity already provisioned.
A rolling update swaps instances a few at a time. It is the default for Kubernetes Deployments, autoscaling group instance refresh and many PaaS products because it needs no extra environment and no custom routing.
Two knobs control the pace: how many extra instances may be created (surge) and how many may be missing (unavailable). With ten replicas, surge 2 and unavailable 0, the controller adds two new pods, waits for readiness, removes two old ones, and repeats.
v1 v1 v1 v1 v1 v1 v1 v1 v1 v1
v1 v1 v1 v1 v1 v1 v1 v1 v2 v2 (surge)
v1 v1 v1 v1 v1 v1 v2 v2 v2 v2
...
v2 v2 v2 v2 v2 v2 v2 v2 v2 v2
strategy:
rollingUpdate:
maxSurge: 2
maxUnavailable: 0
Each old instance gets a termination signal, stops accepting new requests and finishes in-flight work before exit.
Low - small surge capacity
Low - platform native
Low - well understood
Weak readiness probe lets broken pods receive traffic
Rollout stalls halfway leaving a long mixed-version state
Connections are cut because draining is too short