A deployment has a deadline for progress: progressDeadlineSeconds. If the rollout makes no progress in that time, Kubernetes sets the Progressing condition to ProgressDeadlineExceeded and rollout status exits with an error. The old pods keep running.
Symptom
k set image deploy/notes notes-api=172.16.0.126:30500/notes-api:1.11 k rollout status deploy/notes deployment.apps/notes image updated Waiting for deployment "notes" rollout to finish: 1 out of 4 new replicas have been ... error: deployment "notes" exceeded its progress deadline
In the course the deadline is shortened to 30 seconds so that the error shows up quickly.
Diagnosis
Look at the new pod and at the Progressing condition.
k get pods
k get deploy notes \
-o jsonpath='{.status.conditions[?(@.type=="Progressing")].reason}{"\n"}'
NAME READY STATUS RESTARTS AGE
notes-5876dc8f69-9q8hh 0/1 ImagePullBackOff 0 31s
notes-869b66479b-9cnfs 1/1 Running 0 43s
notes-869b66479b-b575x 1/1 Running 0 45s
notes-869b66479b-nchzx 1/1 Running 0 41s
notes-869b66479b-qr48w 1/1 Running 0 47s
ProgressDeadlineExceeded
Causes
ImagePullBackOffTypo in the image tag
In the course the tag is 1.11 instead of 1.1. The new pod never gets past ImagePullBackOff, the rollout stalls.
maxUnavailable 0Why users don't notice
With maxUnavailable 0 all four old pods keep running until a new one is ready. The rollout is stuck, but the service stays available.
Fix
k rollout undo deploy/notes k rollout status deploy/notes deployment.apps/notes rolled back deployment "notes" successfully rolled out
Don't: Waiting for an automatic rollback. Kubernetes does not roll back by itself when the deadline expires.
CKAD hands-on, day 11: rolling updates, pace, history and rollback, a stuck rollout and Recreate.
Go to day 11 →
FAQ
How do I set the deadline?
With spec.progressDeadlineSeconds in the deployment, set to 30 seconds with k patch in the course.