Part of the series CKA prep

What is a Kubernetes Pod, really?

, 1 min read

In plain English

A container is one running program. A Pod is a small wrapper around one or more containers that Kubernetes treats as a single unit. Containers in the same Pod share an IP address and can share files, like roommates sharing one flat.

Kubernetes never runs a container directly. It always runs a Pod, and the Pod runs the containers.

Make one

apiVersion: v1
kind: Pod
metadata:
  name: web
  labels:
    app: web
spec:
  containers:
    - name: nginx
      image: nginx:1.27
      ports:
        - containerPort: 80
kubectl apply -f pod.yaml
kubectl get pods -o wide
kubectl describe pod web

The faster exam way

In the CKA you don’t have time to type YAML from memory. Generate it:

kubectl run web --image=nginx:1.27 --port=80 --dry-run=client -o yaml > pod.yaml

What went wrong for me

My Pod sat in ImagePullBackOff. kubectl describe pod web showed the image tag was mistyped. Always read the Events section at the bottom of describe first.

Takeaway

You rarely create bare Pods in real life. Deployments create them for you, and recreate them when they die. But every troubleshooting session ends at a Pod, so know it well.