CertGrid CertGrid
Hands-on Lab·Certified Kubernetes Application Developer

Controlling a Rollout with maxSurge and maxUnavailable

`maxSurge` and `maxUnavailable` are the only two knobs on a rolling update, and together they decide whether a deploy is invisible to users or an outage. Rather than describe them, this rolls two Deployments with opposite settings at the same instant and counts Pods - one peaks at five with four always available, the other peaks at eight with none. Then `Recreate`, which does not pretend to be safe.

Application Deployment Guide 16 of 44 Intermediate

Written against the versions above. Both default to 25%, rounded - `maxSurge` up, `maxUnavailable` down. The asymmetry is deliberate and it means the defaults never take you to zero available on a Deployment of two or more replicas. A readiness probe with a 25-second delay is used here purely to make the rollout slow enough to observe; the arithmetic is the same at any speed.

Three schedulable workers, so a four-replica Deployment genuinely spreads out and a surge Pod has somewhere to go.
Server NameIP AddressOSRolesCPURAMHDD
CKA1001192.168.0.175Ubuntu 26.04 LTSControl Plane Node2 Core4 GB50 GB
CKA1001-NODE01192.168.0.176Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE02192.168.0.177Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE03192.168.0.178Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB

Before you start

  1. Two Deployments, opposite settings

  2. Roll them both and count

  3. Recreate does not pretend

Official sources