Skip to content
BENIBIX Learn

Kubernetes Pod

Infrastructure☸️ Container OrchestrationKubernetes

Also known as Pod, K8s Pod, Pod (Kubernetes)

The smallest thing Kubernetes runs. It wraps one container, or a few that work as one.

Think of it like

It is like a pea pod. Each pea is a container, and the pod holds them close together.

Example

Emma's web pod holds the app container and a small helper that ships its logs. Both start together, stop together and share one address.

Why it matters

Every app in Kubernetes runs inside pods. Knowing that they come and go explains most of how Kubernetes works.

Definition

A Kubernetes pod is the smallest thing Kubernetes runs. It wraps one container, or a few that must work side by side. The containers in a pod share one network address and can share storage. Pods are throwaway. When one dies, a new one with a new address takes its place. That is why you rarely make a pod by hand.

Example code

yaml
apiVersion: v1
kind: Pod
metadata:
  name: nginx
spec:
  containers:
  - name: nginx
    image: nginx:1.14.2
    ports:
    - containerPort: 80
A pod with one container in it. In real work, a deployment makes pods like this for you.
Pods are the small boxes on each node. Most hold one container, and some hold two.

Common mistake

Putting several unrelated apps in one pod. They then grow, fail and restart as one, when each should stand alone.

Key takeaways

  1. 1
    Smallest unit. Kubernetes places pods, not loose containers.
  2. 2
    Shared address. Containers in a pod share one network address.
  3. 3
    Throwaway. Dead pods are replaced, not repaired.

Compare