Self-healing
What happens when something crashes.
In plain terms
Self-healing is a night watchman who notices a bulb went out and replaces it before you wake up. A pod dies; Kubernetes quietly stands up a fresh one.
You set the desired count once; the loop keeps restoring it (only for controller-managed pods).
One of the biggest reasons to use Kubernetes: it repairs things while you sleep. You declared “three copies”; Kubernetes treats that as a promise it will defend against crashes, restarts, and dead machines.
terminal
$ kubectl get pods -l app=webweb-7d4b-x2f 1/1 Running$ kubectl delete pod web-7d4b-x2f # simulate a crash$ kubectl get pods -l app=webweb-7d4b-p9k 0/1 ContainerCreating # a replacement is already comingweb-7d4b-p9k 1/1 Running # ...and it is back, seconds later
Kill a pod and a fresh one appears in seconds. Lose a whole machine and its pods are recreated on other machines. You set the desired count once, and the reconcile loop keeps restoring it — no pager, no midnight fix.
Only for managed pods
Self-healing works for pods managed by a controller like a Deployment. A bare pod you created by hand is not defended — another reason to always use a Deployment.