Pod vs Container (Kubernetes )
Pod vs Container (Kubernetes )
In Kubernetes (and AKS), a container is the runnable unit of your application (like a single Docker container), while a pod is a higher-level wrapper that can hold one or more containers and is the smallest deployable unit in Kubernetes.
Key Differences Between Pod and Container
| Pod | Container | |
|---|---|---|
| Definition | The smallest deployable unit in Kubernetes that can contain one or more containers. | A lightweight, standalone executable package that includes app code and dependencies. |
| Who manages it? | Managed by Kubernetes (AKS) as a Kubernetes object. | Managed by a container runtime (e.g., Docker, containerd). |
| Composition | Can include multiple containers, shared storage volumes, and shared network namespace. | Single process/environment with its own filesystem and libraries. |
| IP Address & Network | Each pod gets its own IP; containers in the same pod share that IP and network namespace. | Containers inside the same pod do not have separate IPs; they use the pod’s IP. |
| Lifecycle | Created, scheduled, scaled, and deleted by Kubernetes (often via Deployments). | Started and stopped by the container runtime as part of a pod. |
| Scaling | Scaling is done at pod level (more pod replicas). | Containers inside a pod scale together as the pod is replicated. |
| Use Case | Represents a logical application unit (e.g., app container + sidecar/logging container). | Represents a single app component or service (e.g., web server, worker). |
| Configuration | Defined in Kubernetes manifests (YAML) as a Pod spec. | Defined as a container image (Dockerfile) and referenced inside pod specs. |
| Sharing Resources | Containers in a pod share storage volumes and localhost network. | Each container has its own process space and filesystem (from its image). |
| Direct Deployment in Kubernetes | Yes, pods are deployed directly or via higher-level objects (Deployment, ReplicaSet). | No, containers are not deployed directly; they always run inside pods. |
A container is your runnable app unit, and a pod is the Kubernetes wrapper
that groups one or more containers and is what Kubernetes schedules, scales, and manages.