CKAD Multi-Container Pods and Init Containers 1 — Questions and Answers
Question 1: Which multi-container pattern uses a secondary container to handle network communication on behalf of the primary container?
- Sidecar
- Ambassador (Correct answer)
- Adapter
- Proxy
Correct answer: Ambassador
The Ambassador pattern uses a helper container to proxy network connections, abstracting external service discovery from the main container.
Question 2: What is the primary purpose of an Init Container in a Pod?
- To run alongside the main container and share CPU
- To perform setup tasks that must complete before the main containers start (Correct answer)
- To restart the main container when it crashes
- To expose metrics from the main container
Correct answer: To perform setup tasks that must complete before the main containers start
Init containers run to completion before any app containers start, allowing setup like waiting for services or populating volumes.
Question 3: In a multi-container pod, how do containers share network communication?
- Via Kubernetes Services only
- Via shared loopback interface — they share the same network namespace (Correct answer)
- Via mounted shared volumes
- Via ClusterIP addresses assigned to each container
Correct answer: Via shared loopback interface — they share the same network namespace
All containers in a pod share the same network namespace and can communicate on localhost using different ports.
Question 4: Which multi-container pattern uses a helper container to normalize or transform the main container's output?
- Ambassador
- Adapter (Correct answer)
- Sidecar
- Controller
Correct answer: Adapter
The Adapter pattern transforms a container's output (e.g., log format) to a standard format expected by a monitoring system.
Question 5: What happens if an Init Container fails in a Pod?
- The pod continues and skips the init container
- Kubernetes retries the init container until it succeeds or the pod restartPolicy prevents it (Correct answer)
- The main containers start with a warning
- The pod is deleted and not recreated
Correct answer: Kubernetes retries the init container until it succeeds or the pod restartPolicy prevents it
A failing init container is retried by Kubernetes according to the pod's restartPolicy; the main containers do not start until all init containers succeed.
Question 6: How do containers in the same pod share data using a volume?
- Both containers reference the same volume name in their volumeMounts (Correct answer)
- They use a shared PersistentVolumeClaim only
- They communicate via the pod's IP address
- They use Kubernetes Secrets to pass data
Correct answer: Both containers reference the same volume name in their volumeMounts
Containers in a pod can share an emptyDir or other volume by specifying the same volume name in each container's volumeMounts.
Which multi-container pattern uses a secondary container to handle network communication on behalf of the primary container?