CertLumen

Certified Kubernetes Application Developer (CKAD) · Section 1 · 20% of the exam

Understand multi-container Pod design patterns (e.g. sidecar, init and others)

One of the objectives of the Certified Kubernetes Application Developer (CKAD) exam, in the section “Application Design and Build”. Here is what it covers, the points to remember and a question to try.

What it covers

Containers in one Pod share a network namespace and can share volumes, which enables the init, sidecar, ambassador and adapter patterns. This lesson covers startup order, native sidecar containers (init containers with restartPolicy Always, stable since v1.33), shared volumes and how to read logs and status of each container.

Points to remember

  • Containers in a Pod share one IP, port space and optionally volumes; they talk over localhost.
  • Init containers run sequentially to completion before app containers start; a failure blocks the Pod (Init:Error, Init:CrashLoopBackOff).
  • Native sidecar = init container with restartPolicy: Always; stable since Kubernetes v1.33.
  • Sidecars start in order, run for the Pod's life, support probes and shut down after the app containers.
  • A native sidecar does not stop a Job from completing.

Try a question

A Pod web has init containers wait-db and fetch and shows STATUS: Init:0/2. Which command shows why the first init container is not finishing?

  1. Akubectl logs web
  2. Bkubectl logs web -c wait-db
  3. Ckubectl exec web -- cat /var/log/init.log
  4. Dkubectl rollout status pod/web
Show the answer

B. Init container logs are read by naming the container with -c. Plain kubectl logs web targets an app container that has not started yet. exec needs a running container, and rollout status is not for Pods.

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson Multi-Container Pod Patterns: Init, Sidecar and More teaches this objective (about 40 minutes), and 12 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.

More in this section

← Previous objective · All 24 objectives · Next objective →