Lesson 6: Why one Pod isn't enough — meet the Deployment
So far we ran a single Pod — the smallest thing Kubernetes runs, one box with your container inside it. But a single Pod has no safety net: delete it, or lose the node it runs on, and it is simply gone, with nobody bringing it back. In this lesson we meet the Deployment: an object that says "I want
A Deployment is like a restaurant manager who says "always keep three waiters on the floor." If a waiter leaves and never comes back, the manager instantly brings a new one, without you having to ask.
- Deployment
- An object that describes the desired state for a group of identical Pods: how many copies, which container image, and what configuration. It does not count the Pods itself but creates a ReplicaSet that does.
- ReplicaSet
- The controller whose only job is to ensure the number of live Pods equals the desired number. If a Pod is missing it creates one; if there is a surplus it deletes one. The Deployment creates and manages it for you.
- Replicas
- The number of identical copies of the Pod you want running in parallel. The replicas field in the manifest is the desired state the ReplicaSet maintains.
- Self-healing
- Kubernetes' ability to detect that a copy has disappeared and automatically restore it back to the desired state, with no manual intervention.