Courseiva
Application Deployment →easyMultiple Choice

CKAD Application Deployment Practice Question

Which command is used to undo the most recent rollout of a Deployment named 'myapp'?

⚠ Common exam trap

Watch out — candidates often confuse `kubectl rollout undo` with the non-existent `kubectl rollback` command, or assume `--to-revision=2` always undoes the most recent rollout, when in fact it targets a specific revision regardless of recency.

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 by default, effectively undoing the most recent rollout. This command uses the rollout history stored in the Deployment's annotations (e.g., `deployment.kubernetes.io/revision`) to identify and apply the prior ReplicaSet.

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 undo deployment myapp

    Why this is correct

    This command reverts the Deployment to its previous revision, making the prior pod template the current desired state. It works by creating a new ReplicaSet from the last configuration and using the rolling update strategy to replace the current ReplicaSet, thereby undoing the most recent rollout.

  • ✗

    kubectl rollout undo deployment myapp --to-revision=2

    Why it's wrong here

    While this command is syntactically valid, it explicitly targets revision 2, so it rolls back to that arbitrary historical revision rather than the most recent rollout. If the latest change was revision 3 or later, this would skip the immediately preceding state and not satisfy the requirement of undoing the most recent rollout.

  • ✗

    kubectl rollout status deployment myapp

    Why it's wrong here

    This command merely displays the current status of the Deployment's rollout, such as whether it is waiting, running, or successfully progressed. It is a read-only operation that does not alter any state, so it cannot undo changes or revert to a previous revision.

  • ✗

    kubectl rollback deployment myapp

    Why it's wrong here

    There is no such subcommand as 'kubectl rollback' in the Kubernetes CLI; the correct imperative verb is 'rollout undo' under the rollout resource command. Running this would fail with an unrecognized command error, and even if it existed, it would not be the proper syntax for undoing a Deployment rollout.

About these practice questions

This CKAD question is part of Courseiva's 826-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.