0 / 15 lessons — 0%
Lesson 03 / 15

Pods — the smallest deployable unit

Kubernetes never schedules a bare container. The smallest thing it deals with is a Pod — one or more containers that always land on the same node, share the same network namespace (so they can reach each other over localhost), and can share storage volumes.

Most Pods run exactly one container. The multi-container case exists for tightly coupled helpers — a "sidecar" that ships logs, or a proxy sitting in front of your app — things that only make sense living right next to the main container.

Pod — shares network namespace + volumes app container sidecar (logging, proxy...) localhost
Containers in the same Pod talk to each other over localhost, like processes on one machine.
# pod.yaml — the smallest real Kubernetes object you'll write apiVersion: v1 kind: Pod metadata: name: hello-pod spec: containers: - name: hello image: nginx:1.27 ports: - containerPort: 80
kubectl apply -f pod.yaml kubectl get pods kubectl describe pod hello-pod kubectl logs hello-pod kubectl delete pod hello-pod
You'll almost never write a bare Pod like this in practice. A Pod created directly has no one watching over it — if its node dies, it's just gone. That's exactly the gap Deployments fill, next lesson.
Try it yourselfApply the Pod above, then run kubectl delete pod hello-pod yourself and watch — nothing brings it back. Keep that feeling in mind for the next lesson.