Bird
0
0

After running kubectl debug pod/api-1 -c debug --image=busybox, you cannot see the debug container in kubectl get pods. Why?

medium📝 Troubleshoot Q7 of 15
Kubernetes - Troubleshooting
After running kubectl debug pod/api-1 -c debug --image=busybox, you cannot see the debug container in kubectl get pods. Why?
Akubectl get pods only shows pods, not containers
BThe debug container failed to start and was removed
CDebug containers run as ephemeral containers and do not appear as separate pods
DYou need to add --show-containers flag to see debug containers
Step-by-Step Solution
Solution:
  1. Step 1: Understand ephemeral containers

    Debug containers created by kubectl debug run as ephemeral containers inside existing pods, not as separate pods.
  2. Step 2: Check kubectl get pods output

    kubectl get pods lists pods, not individual containers inside pods, so debug containers do not appear separately.
  3. Final Answer:

    Debug containers run as ephemeral containers and do not appear as separate pods -> Option C
  4. Quick Check:

    Ephemeral containers are inside pods, not separate pods [OK]
Quick Trick: Ephemeral debug containers don't show as separate pods [OK]
Common Mistakes:
  • Expecting debug container as separate pod
  • Assuming debug container failed without checking
  • Looking for non-existent flags

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes