Why Kubernetes Heals Itself
Kubernetes self-healing uses continuous reconciliation to detect missing managed pods, create replacements, schedule them, and restore the declared state.
In the full article
Read the transcript
Auto-generated captions; wording may contain recognition errors.
Watch this. We just killed a pod. And there it is. A new one. Different name, only a few seconds old, already running. We didn't create it. No script ran. No CI pipeline [music] kicked off. Something inside Kubernetes noticed a pod was missing and replaced it on its own within seconds. What brought it back? What noticed it was gone? How did it know what to replace it with and where to put the new one? Kubernetes is a declarative state management system for infrastructure. You don't tell Kubernetes how to do things. You tell it what you want to be true [music] and then it continuously works to make reality match your description. It's called a control loop [music] or a reconciliation loop. And it works like this. Step one, observe the current state of the world. Step two, compare [music] it to the desired state, the state you declared. Step three, if they don't match, take action to close the gap. then repeat [music] forever. This is why Kubernetes is self-healing. It's not a feature that was bolted on. [music] It's a natural consequence of the architecture. If a pod crashes and gets evicted, the replica set controller's next loop iteration notices the count is off and it creates a new one. Nobody had to write special crash [music] recovery code. The control loop is the crash recovery


