Lesson in CKA Mock Exam
Question 6: Multi-Container Deployment
Create a Deployment with two containers per Pod, specific images, and specific labels.
Implement the following in Namespace project-tiger:
- Create a Deployment named
deploy-importantwith 3 replicas - The Deployment and its Pods should have label
id=very-important - First container named
container1with imagenginx:1-alpine - Second container named
container2with imageregistry.k8s.io/pause:3.9
Hint 1
A Pod template's own labels don't automatically inherit from the Deployment's metadata labels — they're two separate labels: fields in the manifest, both need setting. And the Deployment's selector has to agree with whatever you put in the Pod template's labels, or the object won't even apply.
Hint 2
Multiple containers in one Pod just means multiple entries in the same list, each with its own name and image — no separate Pod or Deployment needed per container.
- Previous lesson
- Question 5: Allow Frontend to Reach Backend Under Default Deny
- Next lesson
- Question 7: DaemonSet with Resource Requests