Step by step
The example above, written out — the same steps the animation plays.
- 1kubectl apply -f deployment.yaml. You declare the desired state: "run 3 copies of web:v1". Kubernetes keeps making reality match it.
- 2Schedule web-1 → node-1. The scheduler puts each pod on the node with the most room.
- 3Schedule web-2 → node-2. The scheduler puts each pod on the node with the most room.
- 4Schedule web-3 → node-3. The scheduler puts each pod on the node with the most room.
- 5Service: one address for all three. A Service gives the pods one stable name and spreads traffic across the healthy ones.
- 6web-2 crashes. The app inside hit a fatal error. Desired 3, running 2.
- 7Replace it: web-4. The ReplicaSet notices the difference and creates a new pod. No pager needed.
- 8node-3 goes down. The whole machine is gone, with 1 pod on it.
- 9Reschedule → node-1. web-5 starts on a healthy node.
- 10kubectl scale --replicas=5. Traffic is up: change the desired count.
- 11Scale up: web-6 → node-2. New pods join the Service as soon as they are ready.
- 12Scale up: web-7 → node-1. New pods join the Service as soon as they are ready.
- 13Deploy web:v2 (rolling update). Replace pods one at a time, so the app never goes down.
- 14Start web-8 (v2). A v2 pod starts and passes its readiness check…
…and 10 more steps — press Play above to watch them all.
What's happening?
- A Deployment declares "run 3 copies of web:v1"; the scheduler places the pods on nodes.
- When a pod crashes or a node dies, controllers see fewer pods than desired and start new ones elsewhere.
- Scaling changes the desired count; a rolling update swaps pods to the new version one at a time, with no downtime.
Where you'll meet it
Running microservices at most mid-to-large companies, on EKS, GKE or AKS — and the platform underneath many PaaS products.
Common mistake
Skipping readiness and liveness probes: Kubernetes then sends traffic to pods that aren't ready and keeps dead ones running.
FAQ
Pod vs container?
A pod is the smallest unit Kubernetes runs: one or more containers that share a network address and storage.
What does a Service do?
Gives a changing set of pods one stable name and address, and load-balances across the healthy ones.
What does "declarative" mean here?
You describe what you want, not the steps. Controllers keep comparing and correcting, forever.