What is a Pod and why is it the smallest deployable unit?
basicA Pod is one or more tightly coupled containers sharing a network namespace (one IP, localhost between them) and optionally volumes, scheduled together on one node. Kubernetes schedules and restarts Pods, not bare containers.
- Pods are ephemeral: when one dies it is replaced by a new Pod with a new IP and name.
- Multi-container patterns: sidecar (log shipper, proxy), init container (runs to completion before app containers, e.g. DB migrations or waiting for a dependency).
- Do not create bare Pods for apps; use a controller (Deployment).
- Does a restarted container get a new Pod IP? No, container restarts keep the Pod IP; a rescheduled Pod gets a new one.
- Can two containers in a Pod both listen on port 8080? No, they share the network namespace.