Courseiva

CKAD Application Design and Build Practice Question

Which TWO of the following are valid uses of init containers? (Select 2)

⚠ Common exam trap

Kubernetes often tests the misconception that init containers can run continuously or serve as sidecars, but the key trap is that init containers must terminate successfully before the main containers start, so only one-time setup tasks are valid.

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

✓

Setting ownership and permissions on a shared volume before the main container uses it

Init containers run to completion before any pod containers start, making them ideal for filesystem setup tasks like changing ownership (chown) or permissions (chmod) on a shared volume. This ensures the main container can access the volume without requiring privileged mode or extra security context settings.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Running a log collection agent continuously

    Why it's wrong here

    An init container is designed as a short-lived setup process that must exit successfully before any main containers begin. A log collection agent must remain active for the entire pod lifetime, continuously reading stdout/stderr as a sidecar, so it cannot be an init container because the init container would terminate immediately and stop forwarding logs.

  • ✗

    Performing health checks on the main container

    Why it's wrong here

    Liveness and readiness probes, not init containers, are the correct mechanism for health checking workloads because the kubelet runs them against a running main container. During the init phase, the main container has not yet been created, so an init container has nothing to health check; moreover, an init container itself only runs once to completion and cannot report ongoing health.

  • ✓

    Setting ownership and permissions on a shared volume before the main container uses it

    Why this is correct

    Before the main application container starts, an init container can mount a shared volume and apply file ownership, permissions, or SELinux labels using familiar Unix tools like chown and chmod. Because init containers execute sequentially to completion, any changes it makes on the volume persist for main containers, a pattern that is especially useful with persistent volumes or emptyDir mounts.

  • ✗

    Serving HTTP traffic to the main container

    Why it's wrong here

    An init container is not a long-running process; after completing its initialization task it exits, and only then are main containers started. Serving HTTP traffic requires a constantly listening process that stays alive for the duration of the pod, which violates the init container lifecycle and would make the endpoint unreachable.

  • ✓

    Waiting for an external database to be ready before starting the main application

    Why this is correct

    Init containers are ideal for startup synchronization because they can execute a retry loop that polls an external service, for example checking TCP connectivity with nc -z, and only exit when the service is ready. Since the main application container will not be started until every init container has completed successfully, this guarantees that the database is available before the application begins reading or writing data.

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.