Understanding Pods

Pods are the smallest and simplest deployable units in Kubernetes. A pod encapsulates one or more containers that share the same network namespace and storage.

Why Pods?

  • Containers in a pod can communicate via localhost
  • They share volumes and IP
  • Best practice: One container per pod (usually)

Example Pod Definition:

apiVersion: v1
kind: Pod
metadata:
  name: my-nginx
spec:
  containers:
  - name: nginx
    image: nginx
    ports:
    - containerPort: 80
← PrevNext →