CKAD Application Deployment Practice Question
A Deployment has been updated with a new image. After running 'kubectl rollout status deployment/myapp', you see that the rollout has stalled. You want to undo the rollout to the previous revision. What command do you run?
⚠ Common exam trap
It's easy for candidates to confuse 'rollout restart' (which re-deploys the current image) with 'rollout undo' (which reverts to a previous revision), or they mistakenly think manually setting an old image with 'set image' is equivalent to a proper rollback, ignoring Kubernetes' built-in revision management.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
kubectl rollout undo deployment/myapp
'kubectl rollout undo deployment/myapp' reverts the Deployment to the previous revision, which is the standard Kubernetes command for rolling back a stalled or failed rollout. This command uses the Deployment's revision history stored in its annotations to restore the prior pod template specification.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
kubectl rollout restart deployment/myapp
Why it's wrong here
kubectl rollout restart adds the kubectl.kubernetes.io/restartedAt annotation to the Pod template, which forces a rolling restart by creating a new ReplicaSet. This produces a brand-new Deployment revision rather than reverting to a pre-existing one, so the previous working image is not restored. It only changes the object's metadata to trigger a restart, not the underlying container configuration.
- ✓
kubectl rollout undo deployment/myapp
Why this is correct
This is correct because kubectl rollout undo deployment/myapp inspects the Deployment's rollout history, retrieves the spec of the last completed revision, and copies that Pod template back into the Deployment. The change triggers a new ReplicaSet that runs the previously known-good image and performs a rolling update. This is the standard, trackable mechanism for recovering from a bad rollout.
- ✗
kubectl delete deployment/myapp --cascade=orphan
Why it's wrong here
This command removes the Deployment object only, leaving its ReplicaSets and Pods orphaned and running without any controller supervision. It does not revert any image or configuration, and the broken version continues to run indefinitely. It destroys the Deployment's ability to self-heal and scale, which is destructive and completely unrelated to undoing a rollout.
- ✗
kubectl set image deployment/myapp app=old-image
Why it's wrong here
While this manually sets the container image to an earlier tag, it does not consult the Deployment's rollout history or any recorded revision state. You must know the exact image name and tag ahead of time, and the change is applied as a new template update rather than as a restoration of a previous one. A wrong guess can create another failed revision, so it lacks the safety and traceability of kubectl rollout undo.
Go deeper
Related to this question
About these practice questions
Courseiva writes every CKAD question from scratch — 826 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CKAD practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKAD exam.