CKAD Application Design and Build Practice Question
An init container in a pod runs a database migration script. The init container fails and exits with a non-zero exit code. What will happen to the pod?
⚠ Common exam trap
CKAD often tests the confusion between init-container retry behavior (Init:CrashLoopBackOff, retried until success) and main-container CrashLoopBackOff, leading candidates to pick the generic CrashLoopBackOff answer.
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
✓
The init container will be restarted until it succeeds
Init containers run to completion before any app containers start, and Kubernetes treats a non-zero exit as a failure of that init container. The kubelet will restart the failed init container according to the pod's restartPolicy (default Always), retrying until it succeeds. Only after all init containers exit 0 will the main containers be started.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The main containers will start anyway
Why it's wrong here
Init containers run to completion before any main container starts, so a non-zero exit blocks them entirely. This sequencing guarantees dependencies such as migrations finish first; the main containers starting anyway would defeat that guarantee and never happens on init failure.
- ✗
The pod will enter CrashLoopBackOff
Why it's wrong here
CrashLoopBackOff applies to main containers whose processes restart repeatedly after starting. An init container that exits non-zero never reaches that state; kubelet retries the init container according to the pod's restartPolicy, so the pod stays in Init with the init container restarting.
- ✓
The init container will be restarted until it succeeds
Why this is correct
Init containers run to completion before app containers start, so a non-zero exit triggers the pod's restart policy. With the default Always, kubelet reruns that init container until it succeeds, satisfying the stem's requirement that the migration script complete before the pod proceeds.
- ✗
The pod will be deleted and recreated
Why it's wrong here
The pod object is not deleted and recreated when an init container fails; kubelet retains it and retries the init container per restartPolicy. Deletion and recreation occur when a controller such as a Deployment replaces a pod, not from an init container's non-zero exit.
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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CNCF exam blueprint
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.