CKAD Application Design and Build Practice Question
Which of the following is NOT a valid restart policy for a Pod?
⚠ Common exam trap
Watch out — candidates often confuse Kubernetes restart policies with Docker's restart policies (which include 'unless-stopped'), assuming they are identical, but Kubernetes only supports the three explicit policies defined in the PodSpec.
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
✓
UnlessStopped
Kubernetes supports exactly three restart policies for Pods: Always, OnFailure, and Never. 'UnlessStopped' is not a valid restart policy in the Kubernetes API; it is a fabricated option designed to test your knowledge of the allowed values for the `restartPolicy` field in a Pod spec.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
OnFailure
Why it's wrong here
OnFailure is a valid restart policy that tells the kubelet to restart a container only when the container's main process terminates with a non-zero exit code. This is ideal for batch jobs where a failed attempt should be retried, but a successful run should leave the Pod in a completed state. Since Kubernetes explicitly defines it as one of the three supported values, it is not the exception being tested.
- ✗
Always
Why it's wrong here
Always is the default restart policy in Kubernetes, meaning the kubelet will restart the container regardless of whether the exit code indicates success or failure. This ensures long-running services recover from crashes, but it also means a Pod with a successful exit will keep being restarted in a loop. As a core part of the Pod spec, it is absolutely a valid policy, so it cannot be the invalid option.
- ✗
Never
Why it's wrong here
Never is a valid restart policy that instructs the kubelet to never restart a container, even if it crashes or exits with an error. This is often used for one-off tasks where you want to preserve the container's logs and artifacts after it finishes. It is explicitly listed in the Kubernetes API as an accepted value, making it a legitimate choice and not the invalid one.
- ✓
UnlessStopped
Why this is correct
UnlessStopped is not a recognized value for the restartPolicy field in Kubernetes; the only valid values are Always, OnFailure, and Never. It might sound familiar from Docker's own restart policies, but Kubernetes deliberately does not implement it. Attempting to use UnlessStopped in a Pod manifest will cause the API server to reject the definition with an invalid value error.
Go deeper
Related to this question
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 →
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.