Bird
0
0

What will be the output when running kubectl debug pod/web-1 --image=busybox -- sh if the pod web-1 exists and is running?

medium📝 Command Output Q4 of 15
Kubernetes - Troubleshooting
What will be the output when running kubectl debug pod/web-1 --image=busybox -- sh if the pod web-1 exists and is running?
AError: pod web-1 not found
BStarts a new debug container with a shell inside the pod namespace
CDeletes the pod web-1
DScales the pod web-1 to zero replicas
Step-by-Step Solution
Solution:
  1. Step 1: Understand command behavior

    This command creates a new debug container using the busybox image and opens a shell (sh) inside the pod's namespace.
  2. Step 2: Check pod existence

    Since pod web-1 exists and is running, the debug container starts successfully.
  3. Final Answer:

    Starts a new debug container with a shell inside the pod namespace -> Option B
  4. Quick Check:

    Running kubectl debug on existing pod = new debug container [OK]
Quick Trick: kubectl debug runs new container in pod's namespace [OK]
Common Mistakes:
  • Expecting pod deletion
  • Confusing debug with scaling
  • Assuming error if pod exists

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes