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
- Kubernetes1.36.4
- Runtimecontainerd 2.2.6
- CNICalico v3.32.1
- TimeAbout 16 min
- Reviewed23 August 2026
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.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| CKA1001 | 192.168.0.175 | Ubuntu 26.04 LTS | Control Plane Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE01 | 192.168.0.176 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE02 | 192.168.0.177 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE03 | 192.168.0.178 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
Before you start
- A cluster and kubectl.
- The session creates namespace
ckad-rollwith Deploymentscareful(surge 1, unavailable 0),fast(surge 4, unavailable 4) andrecreate, each with four or three replicas and a deliberately slow readiness probe.
-
Two Deployments, opposite settings
-
Roll them both and count
-
Recreate does not pretend