Understanding Pods: The Core Unit of Kubernetes

If you’re learning Kubernetes, you’ll quickly encounter the term Pod — it’s not just another buzzword.
Pods are the smallest deployable unit in Kubernetes, and they serve as the foundation for everything else.

In this post, we’ll explore:

  • What a Pod actually is
  • Why Pods are necessary
  • Pod structure and real examples
  • How to create and inspect a Pod
  • Differences between single and multi-container Pods

Table of Contents


1. What Is a Pod?

A Pod is a logical wrapper around one or more containers.

  • It provides shared networking and storage resources.
  • Most Pods contain a single container.
  • When multiple containers are tightly coupled (e.g., app + helper), they can live in the same Pod.

Kubernetes does not manage containers directly, but manages them through Pods.


2. Why Do We Need Pods?

You might wonder — why not just run containers directly?

Reason 1: Kubernetes Resource Unit

Kubernetes manages resources like scaling, scheduling, and health checks at the Pod level, not individual containers.

Reason 2: Sidecar Pattern

In scenarios like:

  • An app server + log forwarder
  • A web app + cache

Multiple containers can work together in the same Pod, sharing network and sometimes storage.


3. Inside a Pod: Structure

A Pod consists of:

ComponentDescription
ContainersOne or more app containers
Shared networkOne IP address shared among all containers
Shared volumesFor shared data between containers
MetadataName, labels, annotations
PoliciesRestart policy, readiness/liveness probes

Example: Minimal Pod YAML

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
apiVersion: v1
kind: Pod
metadata:
  name: nginx-pod
spec:
  containers:
    - name: nginx
      image: nginx:latest
      ports:
        - containerPort: 80

4. Create a Pod (Quick Start)

1
kubectl run nginx-pod --image=nginx

Check Pod:

1
2
kubectl get pods
kubectl describe pod nginx-pod

Delete Pod:

1
kubectl delete pod nginx-pod

5. Single vs Multi-Container Pods

Single-container Pod (most common)

1
2
3
4
spec:
  containers:
    - name: web
      image: myapp:latest

Multi-container Pod (sidecar pattern)

1
2
3
4
5
6
spec:
  containers:
    - name: app
      image: myapp
    - name: sidecar
      image: fluentd

All containers share:

  • The same network namespace
  • Optionally, volumes

6. Pod Lifecycle Phases

When you run kubectl get pods, you’ll see a STATUS column with phases:

PhaseDescription
PendingPod scheduled but containers not running yet
RunningPod is up and containers are running
SucceededPod completed successfully (Jobs, etc.)
FailedPod crashed or exited with errors
UnknownState cannot be determined

7. Pods Are Ephemeral

Pods are not self-healing.

  • If a Pod fails or crashes, it’s gone.
  • This is why you typically use higher-level resources like ReplicaSet or Deployment to manage Pods.

We’ll explore those in future posts.


8. Full Pod YAML Example

Here’s a real-world Pod definition you can try:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
apiVersion: v1
kind: Pod
metadata:
  name: demo-pod
  labels:
    app: demo
spec:
  containers:
    - name: web
      image: nginx
      ports:
        - containerPort: 80

Apply it:

1
kubectl apply -f demo-pod.yaml

Check it:

1
kubectl get pods

9. Summary

TopicKey Point
What is a Pod?The smallest unit of deployment in Kubernetes
What’s inside?Containers, metadata, shared resources
Single vs MultiMost Pods have 1 container; some have 2+
Pods are ephemeralUse Deployments for auto-recovery
How to createWith kubectl run or YAML manifest

Final Thoughts

Pods are the foundation of all workloads in Kubernetes. Understanding them is critical before diving into more complex resources.