You have a pod that is in 'Pending' state. Which command would you use to view detailed information about the pod's status, including events that may indicate why it is not running?
This is the correct command because it queries the Kubernetes API server for the detailed state, conditions, and event history of the specified Pod. The "Events" section at the bottom of the output will explicitly reveal why the Pod is pending, such as insufficient CPU/memory on nodes, taints and tolerations mismatches, or unbound PersistentVolumeClaims.
Why this answer
C is correct because `kubectl describe pod` provides detailed information about the pod's current state, including status conditions, container statuses, and a chronological list of events associated with the pod. These events often contain error messages (e.g., 'FailedScheduling', 'ImagePullBackOff', 'CrashLoopBackOff') that directly explain why the pod is stuck in 'Pending' state, such as insufficient resources or persistent volume claim issues.
Exam trap
The trap here is that candidates often assume `kubectl logs` can show startup errors even when the pod has never run, or they confuse `kubectl get` with `kubectl describe`, not realizing that `get` only shows a high-level status without the event history needed for troubleshooting.
How to eliminate wrong answers
Option A is wrong because `kubectl get endpoints` displays network endpoints for services, not pod-level status or events; it is irrelevant to diagnosing a pod stuck in 'Pending'. Option B is wrong because `kubectl logs pod` retrieves container logs from a running or previously running container, but a pod in 'Pending' state has not started any containers, so there are no logs to fetch. Option D is wrong because `kubectl get pod` only shows a summary of the pod's phase (e.g., 'Pending') and basic fields like name and age, without the detailed events or conditions needed to identify the root cause.