What does kubectl logs <pod-name> display?

  1. The logs from the specified Pod's containers ✓
  2. The kubelet logs
  3. The API server logs
  4. The logs from all containers in the cluster

Correct answer: The logs from the specified Pod's containers

Option A is correct because kubectl logs followed by a pod name retrieves the standard output and standard error streams from the containers running inside that specific pod, which is the primary mechanism for inspecting application-level log output in Kubernetes. Option B is incorrect because kubelet logs are node-level logs managed by the operating system's service manager and are not surfaced through kubectl logs. Option C is wrong because API server logs are also node-level or control-plane-level logs that require access to the control plane node or a centralized logging solution, not kubectl logs. Option D is incorrect because kubectl logs targets a specific named pod, not all containers across the entire cluster; retrieving cluster-wide logs requires aggregated logging infrastructure.

Topic: · kubectl, pod logs, kubernetes debugging, ckad

Practice Certified Kubernetes App Developer (CKAD) Questions Free