CKAD lab · Troubleshoot and roll back a Deployment
A new image tag is unavailable and a previously healthy revision exists.

Initial conditions
Create Deployment web in a disposable namespace lab using nginx:1.27. Wait for readiness before trying the intentionally missing tag.
Objective
Identify the failure and recover the known-good revision.
Hint
Inspect rollout history and the waiting state of the new Pods.
Solution commands
kubectl -n lab rollout status deployment/web --timeout=60s
kubectl -n lab set image deployment/web nginx=nginx:does-not-exist-example
kubectl -n lab get pods -l app=web
kubectl -n lab rollout history deployment/web
kubectl -n lab rollout undo deployment/webValidate the result
kubectl -n lab rollout status deployment/web --timeout=60s
kubectl -n lab get deployment web -o jsonpath="{.spec.template.spec.containers[0].image}"The healthy image is restored if the previous revision is available. A bad image pull normally leaves the new ReplicaSet unready.
Common mistakes
Recreating the Deployment can discard useful revision history. Confirm the container name before set image.
Free official documentation · Verified 26 November 2026
Use your own disposable Kubernetes environment.
