Bookmarks

Rolling update

A way of rolling out a new version in which old instances are replaced with new ones a few at a time, without stopping the service as a whole.

Also: rolling deployment, rolling upgrade, incremental update

checked 9 Nov

All terms

Instead of shutting the old version down completely and installing a new one — with downtime while the swap happens — the system replaces instances gradually: some are already running the new version, some are still on the old one, and the service keeps responding without interruption. In Kubernetes this mechanism is built into a Deployment.

How it works in Kubernetes

A Deployment creates a new ReplicaSet and smoothly shifts the pod count: the new one grows while the old ones shrink, until every pod runs on the new template. Two parameters set the pace and the headroom during the update; they are written as a number or a percentage, and both default to 25%. With 4 replicas, the update keeps between 3 and 5 pods running:

ParameterWhat it controlsExample with 4 pods
maxSurgehow much the desired count may be exceeded — room for new pods1 → up to 5 pods run during the update
maxUnavailablehow many pods may fall short of the count — the cap on “retired” old pods1 → at least 3 pods answer at any moment

Pods that are shutting down no longer count as available, and a new pod starts receiving traffic only after it passes the readiness check. The minReadySeconds parameter keeps each new pod “on probation”, while progressDeadlineSeconds (600 seconds by default) limits the controller’s patience: if there is no progress for that long, the Deployment is marked as stalled and the on-call engineer sees the problem.

Rollback and when the method fits

If the new version misbehaves, the previous ReplicaSet is kept, and the rollback is kubectl rollout undo — the same rolling process in reverse (you can also return to a specific revision with --to-revision). A rolling update suits stateless services where the old and new versions can run side by side; databases with schema changes need reversible, compatible migrations, while environment configuration changes are more often handled with a blue-green deployment.

Sources

the term is written from these pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • blue-green deployment

    With a blue-green deployment you keep two full environments and switch the traffic in one go; a rolling update replaces pods gradually within a single environment.

  • canary release

    A canary release first sends a small share of traffic to the new version and watches the metrics; a rolling update does not split traffic — it replaces all pods in turn.

In depth in the references

where the topic is covered in detail