Kubernetes · Orchestration under pressure
What is a pod and when would you put multiple containers in one?
Short answer
A pod is the smallest deployable unit: one or more containers sharing a network namespace and volumes. Multiple containers are useful for tightly coupled helpers such as proxies or log shippers.
Containers in a pod are always scheduled together on one node. They share an IP and port space, so they can reach each other over localhost, and they can share volumes. The pod, not the individual container, is the unit of scaling and replacement.
- One container per pod is the common default
- Sidecars suit proxies, log forwarding, metrics exporters and TLS termination
- Init containers run before app containers and must finish successfully
- Pods are ephemeral; do not rely on their identity or local disk
- Use a controller such as a Deployment rather than creating bare pods
apiVersion: v1
kind: Pod
metadata:
name: web
spec:
containers:
- name: app
image: registry.example.com/web:2.1.0
ports:
- containerPort: 8080
- name: log-shipper
image: registry.example.com/shipper:1.0.0
volumeMounts:
- name: logs
mountPath: /var/log/app
volumes:
- name: logs
emptyDir: {}Multi-container pods are tightly coupled by design. If the helper can be scaled or deployed independently, it should usually be its own workload. Shared fate is the trade-off: a crashing sidecar can affect the pod and its readiness.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1When is a sidecar a bad idea?
- 2What is the difference between an init container and a sidecar?
- 3Why should you avoid bare pods in production?
- 4How do containers in a pod communicate?
Say it in the interview
A pod is the smallest unit Kubernetes schedules, containing one or more containers that share a network namespace and volumes. I default to one container per pod, and add sidecars only for tightly coupled concerns like proxying or log shipping. Pods are ephemeral, so I always manage them through a controller and never depend on their IP or local disk.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Kubernetes mock interview and get scored feedback on depth, clarity and confidence.