Draft: not yet run against a live cluster. Treat output as representative and check it on yours.
A rollout is a controlled race between new pods becoming Ready and old pods being removed. Readiness is the referee. Without a good readiness probe, Kubernetes will happily replace every working pod with a broken one and report success.
A Deployment never touches pods directly. It manages ReplicaSets, and each ReplicaSet manages pods for one version of the pod template.
Field
Default
Meaning
strategy.rollingUpdate.maxSurge
25%
How many extra pods may exist during the rollout
strategy.rollingUpdate.maxUnavailable
25%
How many pods may be unavailable during the rollout
minReadySeconds
0
How long a new pod must stay Ready before it counts as available
progressDeadlineSeconds
600
How long without progress before the rollout is marked failed
revisionHistoryLimit
10
How many old ReplicaSets are kept for rollback
Any change to spec.template starts a rollout. Changing replicas doesn’t.
A template change creates a new ReplicaSet. The Deployment controller hashes the pod template; a new hash means a new ReplicaSet, labelled with pod-template-hash.
The controller scales new up and old down in steps , keeping within maxSurge and maxUnavailable. It only scales the old ReplicaSet down when new pods become available (Ready for minReadySeconds).
Progress is tracked as a condition. The Progressing condition is updated as pods become available. If nothing improves for progressDeadlineSeconds, it becomes False with reason ProgressDeadlineExceeded. Kubernetes does not roll back automatically; it just stops and reports.
Old ReplicaSets are kept at zero replicas , up to revisionHistoryLimit, so kubectl rollout undo can scale one back up.
kubectl create deployment web --image=nginx:1.27 --replicas=3
kubectl rollout status deployment/web
kubectl set image deployment/web nginx=nginx:1.27-alpine
kubectl rollout status deployment/web --timeout=120s
kubectl rollout history deployment/web
kubectl get rs -l app=web
kubectl set image deployment/web nginx=nginx:does-not-exist
kubectl rollout status deployment/web --timeout=60s # times out
kubectl rollout undo deployment/web
During the broken rollout, all three old pods keep serving. With three replicas, 25% maxUnavailable rounds down to 0 and 25% maxSurge rounds up to 1, so Kubernetes adds one new pod and removes nothing until that pod is available, which it never is.
Failure: Rollout stalls ProgressDeadlineExceededWhat you see. kubectl rollout status times out, and kubectl describe deployment shows Progressing False ProgressDeadlineExceeded. The new pods are ImagePullBackOff, CrashLoopBackOff, or Running but not Ready.
Root cause. New pods never became available. The reason is on the new pods, not the Deployment.
Diagnose. Find the new ReplicaSet’s pods: kubectl get pods -l app=web and look at the newest ones. Then follow the error page for whatever state they’re in.
Fix. kubectl rollout undo deployment/web restores the previous template immediately, then fix forward. See ProgressDeadlineExceeded .
Failure: Selector can't change field is immutableWhat you see. kubectl apply fails with The Deployment "web" is invalid: spec.selector: Invalid value: ... field is immutable.
Root cause. A Deployment’s selector can’t change after creation, because it defines which pods the Deployment owns. Changing labels in a Helm chart or a refactor triggers this.
Fix. Keep the selector stable and add new labels to the template only. If you must change it, create a new Deployment (blue-green style) and delete the old one once traffic has moved. See Field is immutable .
Failure: Green rollout, broken app Successful rollout, errors in productionWhat you see. The rollout completes and every pod is Ready, but users get errors.
Root cause. The readiness probe checks something that’s true even when the app is broken, such as a static / page, or there’s no readiness probe at all, so a pod counts as Ready as soon as its process starts.
Fix. Make readiness reflect the ability to serve real requests, add minReadySeconds to catch fast crashes, and for high-risk services use progressive delivery (canary with automated analysis) so a bad version is caught on a slice of traffic.
Every Deployment gets a readiness probe. It’s what makes rolling updates safe.
Deploy by digest from a pipeline, not with kubectl set image by hand. GitOps (Argo CD, Flux) gives you an audit trail and a one-commit rollback.
Add a PodDisruptionBudget for every service with more than one replica , so node drains and upgrades can’t take all of them down at once. See Cannot evict pod for the opposite failure.
In regulated production PCI DSS v4.0, SAMA CSF, ISO 27001Rollouts are changes, and changes need records. PCI DSS Requirement 6 expects change control for system components: an approved change, a tested change, and a way back. A merge request approval, the pipeline run, and the Deployment’s revision history together are that record.
Prove you can roll back. Run kubectl rollout undo (or a Git revert through your GitOps tool) in staging on a schedule, and keep the result.
A rollout hits ProgressDeadlineExceeded. Does Kubernetes roll back automatically? No. It marks the Deployment as failed to progress and stops. You roll back with kubectl rollout undo or by reverting the change.
Which change starts a rollout: replicas: 5, or a new environment variable in the container? The environment variable, because it changes the pod template. Scaling replicas doesn’t create a new ReplicaSet.
Why can't you change a Deployment's selector? The selector defines which pods the Deployment owns. Kubernetes makes it immutable so ownership can’t silently change.
Maps to: CKA: Workloads and Scheduling; CKAD: Application Deployment. Check the current exam curriculum, since domain names change between revisions.