Courseiva

CKA Practice Question: Cluster Architecture, Installation and Configuration

An administrator runs 'kubectl run test-pod --image=nginx' and the pod is created but stays in 'Pending' state. Which command would BEST help diagnose why the pod is not running?

⚠ Common exam trap

Test-takers frequently assume `kubectl logs` or `kubectl exec` can diagnose startup issues, but these commands only work on running containers, so they fail silently or with errors when the pod is still pending, wasting time and misdirecting troubleshooting.

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 describe pod test-pod

`kubectl describe pod test-pod` provides a detailed summary of the pod's current state, including events, conditions, and status messages that reveal why the pod is stuck in 'Pending'. The 'Pending' state typically indicates that the pod has not been scheduled to a node, often due to resource constraints (CPU/memory), persistent volume claims not being bound, or node selector mismatches. The 'Conditions' and 'Events' sections in the output directly expose these issues, making it the most effective diagnostic command.

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 logs test-pod

    Why it's wrong here

    The `kubectl logs` command is designed to retrieve the standard output and standard error streams from a *running* container. A pod in a 'Pending' state indicates that its containers have not yet been successfully created, scheduled, or started by the container runtime. Therefore, there are no active container processes from which to collect logs, making this command ineffective for diagnosing a pending pod.

  • kubectl describe pod test-pod

    Why this is correct

    The `kubectl describe pod` command provides a comprehensive, human-readable summary of a specific pod's current state, including its status, conditions, and a chronological list of *events* directly associated with it. For a pending pod, this command is invaluable as it surfaces critical information such as scheduler decisions, volume attachment issues, image pull failures, or resource constraints directly within the 'Events' section, clearly indicating the root cause of the pending state.

  • kubectl exec -it test-pod -- /bin/bash

    Why it's wrong here

    The `kubectl exec` command is used to execute commands *inside* a container that is already running. A pod in a 'Pending' state signifies that its containers have not yet been successfully initialized or started by the container runtime. Since there is no active container process available to attach to or execute commands within, the `exec` command will fail because the target container does not exist in a runnable state.

  • kubectl get events

    Why it's wrong here

    While `kubectl get events` can display cluster-wide events, including those relevant to a pending pod, it often presents a large, unfiltered list that can be challenging to parse. It lacks the structured output and direct association with the pod's specific status, conditions, and resource specifications that `kubectl describe pod` provides. For diagnosing a single pod's pending state, `describe pod` offers a more targeted and efficient approach by consolidating all relevant information.

About these practice questions

One of 302 original CKA 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 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.