Bird
0
0

You ran kubectl set image deployment/myapp myapp-container=myimage:v2 but the new pods crash. Which command helps you revert to the previous version?

medium📝 Troubleshoot Q14 of 15
Kubernetes - ReplicaSets and Deployments
You ran kubectl set image deployment/myapp myapp-container=myimage:v2 but the new pods crash. Which command helps you revert to the previous version?
Akubectl scale deployment/myapp --replicas=0
Bkubectl delete deployment myapp
Ckubectl rollout undo deployment/myapp
Dkubectl get pods --all-namespaces
Step-by-Step Solution
Solution:
  1. Step 1: Identify command to revert deployment

    'kubectl rollout undo' reverts deployment to previous version.
  2. Step 2: Match command with options

    kubectl rollout undo deployment/myapp correctly reverts the deployment; others do not revert updates.
  3. Final Answer:

    kubectl rollout undo deployment/myapp -> Option C
  4. Quick Check:

    Undo rollout = kubectl rollout undo [OK]
Quick Trick: Use rollout undo to revert bad updates quickly [OK]
Common Mistakes:
  • Deleting deployment instead of undoing
  • Scaling replicas to zero instead of reverting
  • Using get pods which only lists pods

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes