Challenge - 5 Problems
Kubectl Debug Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of kubectl debug creating ephemeral container
What is the output when running this command to add an ephemeral debug container to a running pod named
webapp in namespace prod?Kubernetes
kubectl debug -n prod -it webapp --image=busybox --target=webapp -- shAttempts:
2 left
💡 Hint
Think about what kubectl debug does when adding ephemeral containers.
✗ Incorrect
The command adds an ephemeral container named webapp-debugger to the existing pod webapp. The output confirms creation of the ephemeral container.
❓ Troubleshoot
intermediate2:00remaining
Troubleshooting kubectl debug failure due to missing target
You run
kubectl debug -it mypod --image=busybox --target=app but get an error. What is the most likely cause?Attempts:
2 left
💡 Hint
Check if the container name matches exactly inside the pod.
✗ Incorrect
The --target flag specifies the container inside the pod to debug. If the container name is wrong or missing, kubectl debug fails with an error.
❓ Configuration
advanced2:00remaining
Configuring a pod to allow ephemeral containers
Which pod spec snippet correctly enables ephemeral containers for debugging?
Attempts:
2 left
💡 Hint
Consider the default Kubernetes behavior for ephemeral containers.
✗ Incorrect
Ephemeral containers are enabled by default in Kubernetes 1.23+ and do not require special pod spec configuration.
✅ Best Practice
advanced2:00remaining
Best practice for debugging a pod with kubectl debug
What is the recommended approach to debug a running pod without disrupting its main containers?
Attempts:
2 left
💡 Hint
Think about non-disruptive debugging methods.
✗ Incorrect
Adding an ephemeral container allows debugging without stopping or changing the main containers, minimizing disruption.
🧠 Conceptual
expert2:00remaining
Understanding ephemeral container lifecycle
Which statement about ephemeral containers added via kubectl debug is TRUE?
Attempts:
2 left
💡 Hint
Consider how ephemeral containers behave compared to normal containers.
✗ Incorrect
Ephemeral containers are temporary and do not restart automatically if they exit; they are meant for short-term debugging.