Courseiva

CKAD Application Design and Build Practice Question

What is the default restart policy for a pod created with 'kubectl run nginx --image=nginx'?

⚠ Common exam trap

A common misconception is that `kubectl run` creates a bare Pod with no default restart policy, leading candidates to incorrectly assume `OnFailure` or `Never` is the default, when in fact `Always` is the implicit default for any Pod created without an explicit `--restart` flag.

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

✓

Always

The default restart policy for a Pod created with `kubectl run` is `Always`. This is because `kubectl run` generates a deployment-like controller (or a standalone Pod in older versions) that defaults to the `Always` policy, meaning the kubelet will automatically restart the container regardless of its exit code. This ensures the Pod maintains a running state unless explicitly deleted or scaled down.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    Always

    Why this is correct

    The default restart policy for a pod is Always. When you create a pod using `kubectl run` (or any command that doesn't explicitly set `restartPolicy`), the API server defaults the field to `Always`. This means the kubelet will automatically restart the pod's containers whenever they exit, regardless of the exit code, ensuring the pod remains running indefinitely. This is the expected behavior for long-running workloads like Deployments.

  • ✗

    OnFailure

    Why it's wrong here

    `OnFailure` is not the default restart policy for pods; it is a valid value but must be explicitly set in the pod spec. When `restartPolicy: OnFailure` is configured, the kubelet restarts a container only if it exits with a non-zero (failure) exit code. This policy is commonly used for batch jobs or tasks where you want the container to be retried on failure, but the pod should not be restarted if it succeeds. However, if you do not specify it, Kubernetes uses `Always` instead.

  • ✗

    Never

    Why it's wrong here

    `Never` is not the default restart policy for a pod. This value must be explicitly set if you want containers to restart under no circumstances. With `restartPolicy: Never`, the kubelet will not restart a container after it exits, even if it fails. This is useful for short-lived tasks where you want to inspect the pod's logs after it finishes without any automatic retries. But unless you explicitly declare it, the default is `Always`, so a pod created without this field will always have its containers restarted.

  • ✗

    Restart

    Why it's wrong here

    `Restart` is not a valid restart policy value in Kubernetes. The `restartPolicy` field only accepts three values: `Always`, `OnFailure`, and `Never`. If you try to set `restartPolicy: Restart`, the API server will reject the pod creation with a validation error. This option is a distractor because it resembles a plausible policy name, but it does not exist in the Kubernetes API. Always remember that valid values are strictly limited to those three.

About these practice questions

Courseiva writes every CKAD question from scratch — 826 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.