What is a Pod in Kubernetes?
- tool
- Kubernetes
- versions
- Kubernetes 1.x
- os
- any
A Pod is the smallest unit Kubernetes schedules and runs. It wraps one or more containers that always run on the same node and share a network namespace (one IP address, so they talk over localhost) and the Pod's volumes. Most Pods have a single application container, sometimes with helper (sidecar or init) containers.
A minimal Pod
apiVersion: v1
kind: Pod
metadata:
name: web
labels:
app: web
spec:
containers:
- name: nginx
image: nginx:1.29
ports:
- containerPort: 80You rarely create Pods directly: a Deployment (through a ReplicaSet), StatefulSet, DaemonSet or Job creates them from a Pod template and replaces them when they fail or when a node goes away. Pods are disposable and get a new name and IP when recreated, which is why traffic goes through a Service.
Pod phases
| Phase | Meaning |
|---|---|
| Pending | accepted, but not all containers are running yet (scheduling, image pull) |
| Running | bound to a node, at least one container is running |
| Succeeded | all containers exited with status 0 and will not restart |
| Failed | all containers ended and at least one failed |
| Unknown | the node cannot be reached |
CrashLoopBackOff and ImagePullBackOff are not phases but container states (reasons) shown by kubectl get pods; kubectl describe pod NAME shows the events behind them.