Courseiva

CKAD Application Observability and Maintenance Practice Question

You need to see the YAML definition of a running pod named 'app' including the current status. Which command should you use?

⚠ Common exam trap

Many exam-takers confuse `kubectl get pod -o yaml` with `kubectl describe pod`, which provides a human-readable summary but not the raw YAML definition, or they may mistakenly choose `--export` thinking it cleans up the output, not realizing it removes the very status information the question requires.

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 get pod app -o yaml

`kubectl get pod app -o yaml` retrieves the current live state of the pod from the Kubernetes API server and outputs it in YAML format, including the `status` field with the latest conditions, container states, and other runtime information. This command directly queries the API without modifying the object, making it the standard way to view the full definition and status of a running pod.

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 edit pod app

    Why it's wrong here

    kubectl edit pod app is the wrong choice because it does not simply display the YAML definition to stdout; instead it opens an interactive editor where you can modify the pod's live configuration. The command fetches the current object, presents it in a text editor, and when you save and exit, it applies any changes to the cluster — it is a mutating operation, not a read-only view. Even if you leave the file unchanged, the command's purpose and output flow are editing-oriented, so it fails the requirement to "see" the definition in a non-interactive, copyable form.

  • ✓

    kubectl get pod app -o yaml

    Why this is correct

    kubectl get pod app -o yaml is correct because it directly retrieves the live Pod object from the Kubernetes API server and serializes it into YAML, printing the full definition to stdout. This output includes the complete metadata, spec, status, and other fields such as resourceVersion and managedFields, giving you the exact current state of the Pod as known by the cluster. It is the canonical read-only command for viewing a resource's YAML manifest, and unlike editing, it does not require interaction or risk unintended modifications.

  • ✗

    kubectl get pod app -o yaml --export

    Why it's wrong here

    kubectl get pod app -o yaml --export is wrong because the --export flag is deprecated and was designed to strip cluster-specific information like status, namespace, and clusterIP, leaving only a minimal "exportable" manifest. This flag was removed as of kubectl v1.18 because it gave a false sense of a clean definition while hiding critical live data, and it is no longer supported. Therefore, even though the output is YAML, it is not the complete YAML definition of the running pod, so it does not satisfy the task.

  • ✗

    kubectl get pod app -o json

    Why it's wrong here

    kubectl get pod app -o json is wrong because it outputs the resource as JSON, not YAML. While JSON and YAML are both data serialization formats and can often be converted into each other, the explicit requirement is to view the YAML definition. JSON may be more verbose, uses different syntax rules, and lacks YAML comments, so it does not meet the specified output format, making this option incorrect for the stated task.

About these practice questions

This CKAD question is part of Courseiva's 826-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 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.