Courseiva
TroubleshootinghardMultiple ChoiceObjective-mapped

CKA Troubleshooting Practice Question

You want to check the current resource usage (CPU and memory) of pods in the 'default' namespace. Which kubectl command should you use?

⚠ Common exam trap

It's easy for candidates to confuse `kubectl get pods -o wide` or `kubectl describe pods` with resource monitoring, but neither provides live CPU/memory metrics, which only `kubectl top` (with the metrics server) can deliver.

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 pods

`kubectl top pods` retrieves real-time CPU and memory metrics for pods from the metrics server, which is the standard way to check current resource usage in a Kubernetes cluster. This command relies on the Metrics API and requires the metrics server to be deployed.

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 get pods -o wide

    Why it's wrong here

    The `-o wide` output adds the node where the pod is scheduled and the pod's internal IP, but it does not query the metrics server or cAdvisor; it only presents static fields from the pod object and node assignment. Therefore, although it displays more network information, it lacks live CPU and memory consumption figures. For usage, you need the metrics API.

  • kubectl top pods

    Why this is correct

    `kubectl top pods` is the correct command to view current resource usage. It queries the Metrics API, typically served by metrics-server, which aggregates per-container CPU and memory data from kubelet/cAdvisor. The output shows values like CPU in cores or millicores and memory in bytes or mebibytes, giving an accurate snapshot of live consumption. However, it depends on metrics-server being deployed in the cluster.

  • kubectl logs pods

    Why it's wrong here

    Logs capture the standard output and error streams from the container's main process, which may contain application-level messages but do not expose system-level resource usage metrics. The logging pipeline is independent from the metrics pipeline, so even verbose logs are not a reliable or standard way to measure CPU and memory consumption. Therefore, this command cannot answer the resource usage question.

  • kubectl describe pods

    Why it's wrong here

    The `describe` command provides a detailed view of the pod specification, including resource requests and limits, as well as events and status. However, those resource values are static configuration declarations, not live measurements of current utilization. To observe actual CPU and memory consumption, you need a command that fetches from the metrics API, like `kubectl top`, rather than the object spec.

About these practice questions

Courseiva writes every CKA question from scratch — 302 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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CKA 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 CKA exam.