Take a moment to think about this
In Docker, you run a 'container' directly — in Kubernetes, you never run a container directly, it's always wrapped inside a Pod. A Pod can hold a single container (the most common pattern) or a small handful of closely related containers (for example, a main app plus a logging sidecar). Containers within a Pod share network (IP address) and storage — think of it like 'rooms in the same house'.
Let's connect this to a real scenario
You define a Pod with a YAML file and create it with `kubectl apply -f pod.yaml`. If a Pod crashes (or its node dies), Kubernetes can recreate it — but that's not the old Pod 'coming back to life', it's a brand-new Pod (with a new IP address). That's exactly why, in production, you don't run Pods directly but through a Deployment (next lesson) instead.
Let's look at it together
apiVersion: v1
kind: Pod
metadata:
name: my-first-pod
spec:
containers:
- name: web
image: nginx:latest
ports:
- containerPort: 80$ kubectl apply -f pod.yaml
pod/my-first-pod created
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
my-first-pod 1/1 Running 0 10s5-minute try-it
Save the pod.yaml above as a file and run `kubectl apply -f pod.yaml` — check with `kubectl get pods` until the status becomes Running.
A quick word of caution
Creating a Pod directly with `kubectl apply -f pod.yaml` is fine for learning — in production, run it through a Deployment (which includes self-healing).