CKAD Application Observability and Maintenance Practice Question
Which command shows resource usage (CPU and memory) for pods in a namespace?
⚠ Common exam trap
Many exam-takers confuse `kubectl top pod` (which requires the metrics-server) with `kubectl describe pod` (which shows resource requests/limits, not actual usage), or they omit the `-n` flag and assume it works across all namespaces.
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 -n <namespace>
The `kubectl top pod` command is the correct way to view real-time CPU and memory usage for pods in a specific namespace. The `-n <namespace>` flag targets the desired namespace, and the command relies on the metrics-server to collect resource usage data from the kubelet's cAdvisor endpoint.
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 node
Why it's wrong here
kubectl top node reports CPU and memory consumption for cluster nodes, not for pods; kubectl top pod with the namespace flag lists per-pod metrics. The node variant is tempting because it shares the same metrics pipeline, and would be correct when assessing node-level capacity pressure rather than individual pod usage.
- ✓
kubectl top pod -n <namespace>
Why this is correct
This is the correct command because it directly queries the metrics API for pod-level CPU and memory usage from the Metrics Server. The `-n` flag scopes the output to a specific namespace, and when combined with a pod name or label selector it shows live resource consumption for those pods. Without `-n`, it defaults to the current namespace, but specifying it explicitly ensures you are viewing the intended namespace.
- ✗
kubectl top pods
Why it's wrong here
The verb `top` expects a resource type, and the correct resource type is the singular `pod`, not the plural `pods`. Running `kubectl top pods` fails with an error such as 'error: the server doesn't have a resource type "pods"' because kubectl does not accept the plural form in this context. The valid form is `kubectl top pod`, which understands the resource singular, with optional flags like `-n` or `-l`.
- ✗
kubectl get pods --show-labels
Why it's wrong here
This command retrieves pod metadata and displays the labels attached to each pod, along with other Kubernetes object information, not live resource metrics. The `--show-labels` flag has no effect on CPU or memory because those values are not stored in the pod's API object; they are collected separately by the Metrics Server. To see actual resource usage, you must use `kubectl top pod`.
Go deeper
Related to this question
About these practice questions
This CKAD question is part of Courseiva's 826-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.