current leader. Etcd stores the persistent master state while other components watch etcd for changes to bring themselves into the desired state. In order to asynchronously monitor changes to keys, etcd includes a watch feature. If a key is changed, the watcher is notified so that the right business logic is updated to its desired state. Scheduler This component watches the API for unscheduled pods, then finds a machine for them to run and informs the API server of the best choice. The job of the scheduler is to make sure that resources needed are available. For exam- ple, there might be low memory or not enough disk space. The scheduler can look for another pod that can handle the task. Controller manager The controller manager server watches etcd for changes to replication controller objects and then uses the API to enforce the desired state. Several such processes create a cluster with one active leader at a time. Kubelet The kubelet is the lowest level component in Kubernetes and is responsible for knowing what is running on each machine. Therefore, the kubelet has a single task: it keeps a set of containers running. It is basically an agent on the node that actually starts and stops containers and com- municates with the Docker engine at a host level. The kubelet interacts with the API Server and watches to make sure that pods are bound to its node and are 51
