What is a Kubernetes Pod?
· Category: Kubernetes
Short answer
A Pod is the smallest and simplest Kubernetes object. It represents a single instance of a running process and can contain one or more tightly coupled containers that share storage and network resources.
How it works
Containers in the same Pod share the same network namespace, IP address, and port space. They communicate via localhost and can mount shared volumes. Pods are ephemeral by design; controllers like Deployments manage their lifecycle.
Example
apiVersion: v1
kind: Pod
metadata:
name: mypod
spec:
containers:
- name: app
image: myapp
ports:
- containerPort: 8080
- name: sidecar
image: logging-agent
Why it matters
Pods abstract the container runtime from the orchestration layer. They enable sidecar patterns, init containers, and tightly coupled multi-container applications. Understanding Pods is fundamental to designing Kubernetes workloads.
Common issues
- Pods are not self-healing; use Deployments or StatefulSets for resilience.
- Multi-container Pods increase coupling and complicate independent scaling.
- Pod IP addresses change on restart; use Services for stable networking.