Courseiva

CKAD Application Observability and Maintenance Practice Question

A deployment 'web-app' is running with 3 replicas. Users report that the application is slow. The team suspects a memory leak. Which command provides the most immediate insight into the memory usage of the pods?

⚠ Common exam trap

Watch out — candidates often choose `kubectl logs` thinking application logs will reveal memory leak details, but logs only show application output, not raw memory metrics, and `kubectl top pod` is the standard tool for immediate resource usage insight.

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

`kubectl top pod` directly queries the metrics server to display real-time CPU and memory usage for each pod, providing the most immediate insight into whether a pod is consuming excessive memory due to a suspected leak. Unlike logs or events, it gives quantitative resource utilization data without requiring additional configuration or parsing.

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 describe deployment web-app

    Why it's wrong here

    kubectl describe deployment web-app retrieves the full desired-state specification of the Deployment, including replica counts, rollback history, labels, selectors, and recent events, but it does not query the Kubernetes metrics pipeline. It only shows what Kubernetes intends to run, not how much memory the running containers are actually consuming. Because memory usage is a live metric collected by kubelet and exposed through metrics-server, this command cannot answer the user's question.

  • ✗

    kubectl get events

    Why it's wrong here

    kubectl get events lists cluster-scoped lifecycle events such as pod scheduling, image pulls, probe failures, and NodePressure warnings, which are triggered by state transitions rather than sampled at regular intervals. While an OOMKill event might indirectly indicate that a container exceeded its memory limit, the command provides no current, per-pod memory usage value. It gives historical occurrence data, not the real-time telemetry needed to see how much memory is being used this moment.

  • ✗

    kubectl logs <pod>

    Why it's wrong here

    kubectl logs <pod> streams or prints the combined stdout/stderr output from the containers in the pod, which is entirely controlled by the application code and logging configuration. Unless the application itself writes periodic memory statistics to the log, there is no guarantee that any memory information appears, and Kubernetes does not inject such data. The logs are not connected to the cAdvisor/metrics-server path that measures actual memory consumption, so this command is the wrong tool for resource monitoring.

  • ✓

    kubectl top pod

    Why this is correct

    kubectl top pod is the correct choice because it directly queries the metrics-server (via the metrics.k8s.io API) for live CPU and memory usage data per pod and per container. It returns a compact table of instantaneous resource usage, such as MEMORY and MEMORY% columns, which is exactly what a user needs to inspect memory consumption across the three replicas. This command requires the metrics-server to be deployed and properly configured in the cluster to function.

About these practice questions

One of 826 original CKAD practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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 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.