CKAD Application Observability and Maintenance Practice Question
A developer wants to view the resource usage of all containers in a specific pod. Which command should they use?
⚠ Common exam trap
Watch out — candidates often assume `kubectl top pod <pod>` alone shows container-level details, but without the `--containers` flag it only shows pod-level aggregates, leading them to choose option C instead of D.
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 top pod <pod> --containers
`kubectl top pod <pod> --containers` displays per-container CPU and memory metrics for a specific pod, which is exactly what the developer needs to view resource usage of all containers within that pod. The `--containers` flag is essential to break down the pod-level metrics into individual container-level metrics.
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 top pods --all-namespaces
Why it's wrong here
kubectl top pods --all-namespaces is incorrect because it retrieves pod-level CPU and memory metrics for every pod across all namespaces, aggregating all containers within each pod into a single number. This command does not offer a per-container view, nor does it target a specific pod, so the developer cannot identify which container consumes resources.
- ✗
kubectl top pods
Why it's wrong here
kubectl top pods (without a pod name) displays resource utilization for all pods in the current namespace, again at the aggregate pod level. It sums the usage of all containers inside each pod, obscuring individual container metrics; the developer needs to scope to one pod and use --containers to drill down.
- ✗
kubectl top pod <pod>
Why it's wrong here
kubectl top pod <pod> shows the total CPU and memory usage for the named pod, but the default output combines all containers into a single pod-level entry. Without the --containers flag, the command does not break down usage by individual container, so it does not fulfill the requirement to view all containers' resource usage.
- ✓
kubectl top pod <pod> --containers
Why this is correct
kubectl top pod <pod> --containers is the correct command because it lists each container within the specified pod separately, showing its individual CPU and memory consumption. This gives the developer the exact per-container resource usage needed, making it the only option that satisfies the requirement directly.
Go deeper
Related to this question
About these practice questions
Courseiva writes every CKAD question from scratch — 826 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.