Bird
0
0

Which of these is a valid reason to use kubectl debug instead of kubectl exec?

easy📝 Conceptual Q2 of 15
Kubernetes - Troubleshooting
Which of these is a valid reason to use kubectl debug instead of kubectl exec?
ATo restart the pod automatically after failure
BTo permanently change the pod's container image
CTo list all pods in the cluster
DTo run a new container with debugging tools when the original container lacks them
Step-by-Step Solution
Solution:
  1. Step 1: Compare kubectl debug and kubectl exec

    kubectl exec runs commands inside existing containers, but if the container lacks debugging tools, it won't help. kubectl debug can add a new container with tools.
  2. Step 2: Understand other options

    Changing images, restarting pods, or listing pods are unrelated to debugging with kubectl debug.
  3. Final Answer:

    To run a new container with debugging tools when the original container lacks them -> Option D
  4. Quick Check:

    Use case for kubectl debug = Add debug container [OK]
Quick Trick: Use kubectl debug to add tools missing in original container [OK]
Common Mistakes:
  • Thinking kubectl debug changes pod images
  • Confusing debug with pod restart
  • Using debug to list pods

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes