Skip to main content
Course/Primitives/Pods β€” The Atomic Unit
1/860 min
Primitives

Pods β€” The Atomic Unit

The smallest deployable unit in Kubernetes.

beginner60 minRead β†’ Lab β†’ Quiz β†’ Practice
🧠 Brain Warm-Up
🧠 Brain Warm-Up: If a Pod contains multiple containers (e.g. an API server and a logging agent), how do they communicate with each other? Can they listen on the same port? Think about their network boundaries before reading.

What is a Pod?

A Pod is the smallest deployable unit in Kubernetes. It wraps one or more containers that share the same network namespace, IP address, and storage volumes.

Key facts:

  • Every Pod gets one IP address β€” all containers inside share it.
  • Containers in the same Pod communicate via localhost on different ports. They cannot bind to the same port.
  • Pods are ephemeral β€” when they die, their filesystem is gone.
  • In practice, you almost never create bare Pods β€” you use Deployments instead.

Pod vs Container

FeatureDocker ContainerKubernetes Pod
NetworkIts own IPShared with all co-located containers
LifecycleIndividualAll containers start/stop together
ManagementManualOrchestrated by Kubernetes

Pod Architecture (Shared Network & Storage)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       POD                               β”‚
β”‚  IP Address: 10.244.1.5 (Shared Network Namespace)      β”‚
β”‚                                                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Primary Container    β”‚   β”‚   Sidecar Container   β”‚  β”‚
β”‚  β”‚  (e.g., Node.js API)  β”‚   β”‚  (e.g., Logging Agent)β”‚  β”‚
β”‚  β”‚  Port: 8080           β”‚   β”‚  Port: 9000           β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚             β”‚ (Communicate via localhost)β”‚              β”‚
β”‚             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ίβ—„β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
β”‚             β”‚                            β”‚              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚      Volume Mount     β”‚   β”‚      Volume Mount     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚             β”‚                            β”‚              β”‚
β”‚             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ίβ—„β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
β”‚                           β”‚                             β”‚
β”‚                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”                    β”‚
β”‚                  β”‚  emptyDir Vol   β”‚                    β”‚
β”‚                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Pod Lifecycle

Pending β†’ Running β†’ Succeeded
                ↓
             Failed β†’ (restart policy)
  • Pending β€” scheduled but waiting for image pull or resources.
  • Running β€” at least one container is running.
  • Succeeded β€” all containers exited with code 0.
  • Failed β€” at least one container exited non-zero.