Controllers and reconciliation
The control loop at the heart of Kubernetes: desired vs actual state, Deployments, ReplicaSets and the kubelet.
Transcript
Kubernetes is built on control loops. A controller watches the current state and compares it to the desired state.
A Deployment asks for three replicas. The controller looks, and finds only two pods running.
So it creates one more pod. The loop never stops: observe, compare, act.
That is why Kubernetes is declarative. You state the goal, and controllers keep reality matching it, even after failures.
A Deployment manages a ReplicaSet, and the ReplicaSet manages the pods. Each layer has its own controller.
The kubelet runs a loop too: it makes sure the containers on its node match the pods assigned to it.
Observe. Compare. Act.
More in this series
1:30Inside Kubernetes
The control plane and the nodes: API server, etcd, scheduler, controllers and kubelet, and how a pod gets created.
1:30What does etcd do?
etcd as the Kubernetes database: keys, leader election, Raft quorum, watches and backups.
1:09How the scheduler works
How kube-scheduler picks a node for a pod: filtering, scoring, binding, and how to influence it.