Sub topic 15
Diagnosing a stalled rollout
This chapter assumes you can read Deployment manifests and use kubectl get, describe and rollout. It also assumes you know how a Deployment creates one ReplicaSet per Pod template, and what a readiness probe does.
What "stalled" means
A rolling update stalls when new Pods never become ready. Kubernetes does not undo the update on its own. The old ReplicaSet keeps serving traffic, and the new ReplicaSet stays below its target.
The Deployment controller watches for this. If no progress happens for progressDeadlineSeconds (600 by default), it sets the condition Progressing=False with reason ProgressDeadlineExceeded. The rollout is marked failed, but the controller keeps trying. You decide whether to fix it or roll back.
Follow the chain
Work from the Deployment down to the Pod.
- Check the rollout.
- Compare the ReplicaSets.
- Inspect the Pods of the new ReplicaSet.
- Read events and logs.
kubectl rollout status deployment/web --timeout=60s
kubectl get rs -l app=web
kubectl get pods -l app=web
kubectl describe pod <new-pod-name>
kubectl logs <new-pod-name>
kubectl describe deployment webrollout status waits and exits non-zero on timeout or when the deadline is exceeded. In get rs, the new ReplicaSet (newest hash) shows DESIRED higher than READY, while the old one still holds ready Pods. The Pod status column then points to the cause.
Common causes
| Pod state | Typical cause | Where to look |
|---|---|---|
| `ImagePullBackOff` / `ErrImagePull` | Wrong tag, typo, or missing registry credentials | `describe pod` events |
| `CrashLoopBackOff` | Container exits on start: bad config, missing env var | `kubectl logs --previous` |
| `Running` but `0/1` ready | Readiness probe fails: wrong path or port | `describe pod`, probe events |
| `Pending` | Not enough CPU or memory, or no node matches | Events: `FailedScheduling` |
Readiness failures are the subtle case. The container runs and logs look healthy, but the probe path or port is wrong. Because the Pod never becomes ready, the rollout waits, and the deadline eventually fires.
Recover
If the fix is a typo, correct the manifest and apply it. That creates a new template and a new rollout. If it is not obvious, roll back:
kubectl rollout undo deployment/web
kubectl rollout status deployment/webThe undo restores the previous template, which reuses the old ReplicaSet and clears the failed condition.
Exercise
You run kubectl set image deployment/web web=nginx:1.266. After ten minutes, rollout status reports the deadline exceeded. maxSurge is 1 and maxUnavailable is 0. What state are the new Pods in, and is the application still serving traffic?
Show answer
The new Pods are in ImagePullBackOff (or ErrImagePull) because the tag does not exist. The application still serves traffic, because maxUnavailable: 0 kept the old ReplicaSet's Pods running. Fix it with kubectl rollout undo deployment/web or by setting a valid image tag.