Pods
The smallest deployable unit in Kubernetes — what a Pod is and how to work with one.
A Pod is the smallest deployable unit — one or more containers that share a network namespace (same IP, can talk over localhost) and storage volumes, always scheduled together on one node.
You rarely create bare Pods directly; controllers like Deployments manage them so they’re recreated if they die. Multiple containers in a Pod are for tightly- coupled helpers — a sidecar (log shipper, proxy) — not separate applications.
Key Pod concepts: resource requests/limits (CPU/memory), probes (liveness/readiness), and restart policy. Pods are ephemeral — their IPs change, which is why Services exist.
apiVersion: v1
kind: Pod
metadata:
name: web
spec:
containers:
- name: nginx
image: nginx:1.27
ports: [{ containerPort: 80 }]
resources:
requests: { cpu: "100m", memory: "128Mi" }
limits: { cpu: "500m", memory: "256Mi" }
readinessProbe:
httpGet: { path: /, port: 80 }kubectl apply -f pod.yaml
kubectl get pods
kubectl describe pod web
kubectl logs web - Write a minimal Pod manifest running an nginx container.
- Add CPU/memory requests and limits and explain the difference.
- Add a readiness probe and describe what it controls.
- Explain why you’d use a Deployment rather than a bare Pod.
Cheat Sheet▾
| Concept | Detail |
|---|---|
| Pod | Smallest unit; 1+ containers |
| Shared | Network (IP) + volumes |
| Sidecar | Helper container in a Pod |
| Requests | Guaranteed resources |
| Limits | Maximum resources |
| Liveness probe | Restart if unhealthy |
| Readiness probe | Gate traffic |
Common Interview Questions▾
What is a Pod?
The smallest deployable unit in Kubernetes — one or more containers sharing a network namespace (one IP) and storage, scheduled together on one node.
What's the difference between a liveness and a readiness probe?
A liveness probe restarts a container that’s stuck; a readiness probe controls whether the Pod receives traffic, removing it from Service endpoints when not ready.
Why use multiple containers in one Pod?
For tightly-coupled helpers (sidecars) that must share the Pod’s network and storage — like a log forwarder or proxy — not for unrelated applications.