What is a Kubernetes Pod?
A Kubernetes Pod is the smallest unit you can deploy and schedule in Kubernetes: a group of one or more containers that share one IP address, the same storage volumes and a common lifecycle. All containers in a Pod always run together on the same node. Most Pods hold a single application container, and you rarely create Pods yourself; controllers such as Deployments create and replace them for you.
Pod vs container
A container is a running instance of an image: one process tree, isolated by the kernel. A Pod is the Kubernetes object that wraps one or more containers and gives them a shared environment. Kubernetes schedules Pods, not containers. The scheduler picks a node for the whole Pod, and the kubelet on that node starts every container in it through the container runtime.
The extra layer exists for helpers that must sit next to the main process: a log shipper that reads the same files, a proxy that handles the application’s traffic or a process that refreshes credentials on a shared volume. Putting them in one Pod guarantees that they run on the same machine and can talk over localhost.
What containers in a Pod share
According to the Kubernetes documentation, a Pod’s containers share network and storage resources and a specification for how to run them.
| Shared | What it means |
|---|---|
| Network | One IP address and one port space. Containers reach each other on localhost and cannot both listen on the same port. |
| Volumes | Volumes are defined at the Pod level, and each container mounts the ones it needs. |
| Node and lifecycle | The Pod is scheduled once, so all its containers land on the same node and are removed together. |
| Not shared by default | Each container keeps its own file system from its image, its own processes and its own CPU and memory requests and limits. |
Because a Pod’s resource request is the sum of its containers’ requests, the scheduler needs room for all of them on one node. How those numbers are set and enforced is covered in Kubernetes requests and limits.
Init containers and sidecar containers
A Pod can declare two kinds of helper containers next to its application containers:
- Init containers run one after another before the application starts, and each must finish successfully. They prepare things such as database migrations or configuration files.
- Sidecar containers start before the application and keep running alongside it. Kubernetes implements them as init containers with
restartPolicy: Always. Native sidecars were first available in Kubernetes 1.28, active by default since 1.29 and stable since 1.33.
apiVersion: v1
kind: Pod
metadata:
name: web
spec:
initContainers:
- name: log-shipper
image: alpine:3.20
restartPolicy: Always
command: ["sh", "-c", "tail -F /var/log/app/app.log"]
volumeMounts:
- name: logs
mountPath: /var/log/app
containers:
- name: app
image: nginx:1.27
volumeMounts:
- name: logs
mountPath: /var/log/app
volumes:
- name: logs
emptyDir: {}Before native sidecars, helpers were ordinary containers, which caused two known problems: a helper could start after the application needed it, and a helper that never exited kept a Job from completing. Native sidecars solve both. A helper belongs in a separate Deployment instead when it serves many Pods or needs to scale independently.
Pod lifecycle
Every Pod reports a phase in its status. The phases are:
| Phase | Meaning |
|---|---|
Pending | Accepted by the cluster, but containers are not running yet. Includes time waiting for a node and pulling images. |
Running | Bound to a node, all containers created, at least one running or restarting. |
Succeeded | All containers exited successfully and will not restart. |
Failed | All containers terminated and at least one failed. |
Unknown | The Pod’s state cannot be read, usually because the node is unreachable. |
Each container inside the Pod is Waiting, Running or Terminated. The Pod’s restartPolicy decides what happens when a container exits: Always (the default) restarts it, OnFailure restarts it only after a non-zero exit code, and Never leaves it stopped. The kubelet restarts containers on the same node with an increasing delay, which is what the CrashLoopBackOff status reports.
A Pod is never moved. If its node fails or the Pod is deleted, that Pod is gone. A controller creates a replacement with a new name and usually a new IP address, which is why clients reach Pods through a Service instead of Pod IPs.
Why you rarely create Pods directly
A Pod created on its own has no owner. Nothing recreates it after a node failure, scales it or rolls out a new image version. In practice, you describe a Pod template inside a workload controller, and the controller manages the Pods:
- A Deployment keeps a number of identical, interchangeable replicas running.
- A StatefulSet gives each replica a stable name and its own volume.
- A DaemonSet runs one Pod on every node.
- A Job runs Pods until a task completes.
Which one fits which workload is explained in Deployment vs StatefulSet vs DaemonSet vs Job.
Pods on Cloudfleet
In Cloudfleet Kubernetes Engine (CFKE), node auto-provisioning reads the requests, labels and affinity rules of pending Pods to choose the number and size of nodes to create.