What will be the current version of the deployment 'myapp' after the last command?
medium
A. Version 1 (deployment-v1.yaml)
B. Version 2 (deployment-v2.yaml)
C. No change, still version 2
D. Deployment deleted
Solution
Step 1: Understand deployment updates
First, version 1 is applied, then version 2 updates the deployment.
Step 2: Rollback command effect
The rollback command reverts the deployment to the previous version, which is version 1.
Final Answer:
Version 1 (deployment-v1.yaml) -> Option A
Quick Check:
Rollback reverts to last version before update [OK]
Hint: Rollback returns to version before last update [OK]
Common Mistakes:
Assuming rollback deletes deployment
Thinking rollback keeps current version
Confusing rollback with reapply
4. You tried to rollback a deployment using kubectl rollout undo deployment/myapp but got an error: error: no rollout found. What is the most likely cause?
medium
A. Rollback command requires a namespace flag.
B. You misspelled the deployment name in the command.
C. The deployment 'myapp' has no previous versions to rollback to.
D. The Kubernetes cluster is down.
Solution
Step 1: Analyze the error message
The error 'no rollout found' means no previous rollout history exists for rollback.
Step 2: Identify cause
This usually happens if the deployment was never updated or has only one version.
Final Answer:
The deployment 'myapp' has no previous versions to rollback to. -> Option C
Quick Check:
No rollout history = no rollback possible [OK]
Hint: Check rollout history before rollback [OK]
Common Mistakes:
Assuming cluster is down causes this error
Forgetting to check deployment name spelling
Thinking rollback always works without history
5. You have a deployment 'api-server' with three revisions in history. You want to rollback to revision 2 specifically. Which command should you use?
hard
A. kubectl rollout undo deployment/api-server revision=2
B. kubectl rollback deployment/api-server --revision=2
C. kubectl undo deployment/api-server revision 2
D. kubectl rollout undo deployment/api-server --to-revision=2
Solution
Step 1: Recall rollback to specific revision syntax
The correct syntax to rollback to a specific revision is kubectl rollout undo deployment/<name> --to-revision=<number>.