Pods: The Basic Unit of Deployment
What you'll learn: How Kubernetes pods serve as the smallest deployable unit that wraps one or more containers into a cohesive execution environment.
The Core Concept
A pod is Kubernetes' fundamental building block—the smallest unit you can create, deploy, and manage. While containers are where your application code runs, you don't deploy containers directly in Kubernetes. Instead, you deploy pods, which serve as logical wrappers around one or more tightly coupled containers.
Think of a pod like a shared apartment: the containers inside are roommates sharing the same living space (network namespace), utilities (storage volumes), and address (IP address). They can communicate with each other via localhost and share mounted files directly.
Why Pods Exist
Pods solve a specific problem: some applications need helper processes (called "sidecar" containers) that must run alongside the main container. For example, a web server container might need a logging agent container to collect and forward logs. These containers need to:
- Share the same network namespace (same IP address)
- Share storage volumes
- Be scheduled together on the same node
- Start and stop as a single unit
The pod abstraction bundles these containers together so Kubernetes treats them as one deployable entity.
Single vs Multi-Container Pods
Most pods contain just one container—this is the typical pattern. Multi-container pods are used only when containers are truly inseparable, such as a primary application with a sidecar for monitoring, logging, or proxying.
Each pod gets its own unique IP address within the cluster, and containers inside the pod communicate via localhost.
Key Takeaway: Pods are Kubernetes' atomic deployment unit that encapsulate one or more containers, providing them with a shared network and storage context while being scheduled and managed as a single entity.