CKAD Application Design and Build Practice Question
You need to debug a pod that is not responding. Which command attaches an ephemeral debug container to a running pod named 'web-pod'?
⚠ Common exam trap
Candidates often confuse `kubectl debug` with `kubectl run` or `kubectl attach`, assuming any command that creates a new interactive shell will work, but only `kubectl debug` with the `--image` flag correctly attaches an ephemeral container to the existing pod without copying or replacing it.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
kubectl debug -it web-pod --image=busybox --target=web-container
`kubectl debug` with the `--image` flag creates an ephemeral container in the specified pod for interactive debugging. The `-it` flag provides an interactive TTY, and `--target=web-container` attaches the ephemeral container to the same Linux namespace as the target container, allowing direct troubleshooting of the unresponsive pod without modifying its original containers.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
kubectl debug web-pod --copy-to=debug-pod --image=busybox
Why it's wrong here
Creates a copy of the pod, not an ephemeral container.
- ✓
kubectl debug -it web-pod --image=busybox --target=web-container
Why this is correct
Correct command to add an ephemeral debug container.
- ✗
kubectl attach web-pod
Why it's wrong here
Attaches to existing container, not adds a new one.
- ✗
kubectl run debug --image=busybox -it
Why it's wrong here
Creates a new Pod, not an ephemeral container.
Go deeper
Related to this question
About these practice questions
This CKAD question is part of Courseiva's 160-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CKAD practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKAD exam.