Courseiva

CKAD Application Design and Build Practice Question

A pod with an init container and a main container has 'restartPolicy: Always'. The init container exits with code 0. What happens next?

⚠ Common exam trap

Many candidates confuse init container behavior with main container behavior, assuming that `restartPolicy: Always` applies to init containers or that a successful init container causes the pod to complete.

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 main container starts; if it fails, it will be restarted

When an init container exits with code 0, it indicates successful completion. With `restartPolicy: Always`, the pod's main container then starts. If the main container fails, Kubernetes restarts it according to the `restartPolicy`, which is `Always` in this case, so the main container will be restarted indefinitely.

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 pod enters CrashLoopBackOff because the init container should not exit

    Why it's wrong here

    Init containers are designed to run to completion before the main container starts. Exiting with a zero exit code is a successful completion, not a failure; CrashLoopBackOff is triggered only when a container repeatedly exits non-zero or fails to start. Since this init container exited successfully, the pod would not enter CrashLoopBackOff because of that exit.

  • ✓

    The main container starts; if it fails, it will be restarted

    Why this is correct

    Once all init containers have exited successfully, Kubernetes proceeds to start the main application container. From that point, the pod's restartPolicy (Always, in this case) governs the main container: any failure or non-zero exit triggers a restart by the kubelet, possibly with an exponential backoff. The init container will not be re-executed when the main container restarts, so the pod remains active until the main container exits cleanly.

  • ✗

    The pod is considered complete and enters Succeeded phase

    Why it's wrong here

    The Succeeded phase is reserved for pods whose containers have all completed with exit code 0 and whose restartPolicy is Never or OnFailure. With restartPolicy Always, which is the default and commonly used for long-running workloads, a failing main container is restarted rather than permitted to terminate the pod. Therefore, the pod cannot enter Succeeded phase while it is running indefinitely; it remains in Running or CrashLoopBackOff if restarts keep failing.

  • ✗

    The init container restarts and runs again

    Why it's wrong here

    Init containers in Kubernetes run sequentially to completion during pod startup and are never re-run after they have successfully finished. If an init container had failed, the entire pod would be restarted, potentially causing the init sequence to execute again — but a successful exit means that init container is permanently done. Thus, after the main container has started, the init container will not be restarted or run again.

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.