CK.I · CKAD practice question
A Pod runs a main web container and a traditional log-rotator sidecar in spec.containers, sharing an emptyDir volume mounted at /var/log/app. How should you configure that sidecar so it runs continuously alongside the main container and stops cleanly when the Pod terminates?
Check answer and explanation
Correct answer: Define it in spec.containers with restartPolicy: Always
Explanation
A traditional sidecar that should run concurrently for the full lifetime of the Pod is defined in spec.containers with restartPolicy: Always so kubelet manages and terminates it with the Pod. Kubernetes also supports native sidecar containers via initContainers with restartPolicy: Always; this item asks for the traditional spec.containers form, not the native initContainers sidecar.
Common trap
A traditional sidecar that should run concurrently for the full lifetime of the Pod is defined in spec.containers with restartPolicy: Always so kubelet manages and terminates it with the Pod.
Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.