Controller is a process which continuously monitors the state of the kubernetes cluster's component and takes proper action to keep the cluster running its its desired state. For example, Node Controller monitors the state of the nodes and if any node is down, it brings it back through a series of operations. Let us inderstand it in detail.
Node controller monitors the health of the node througg kube-api server. It receives heart-beat from each node evey 5 sec. If it stops receiving the hear-beat, it marks the node as unreachable. Before marking it unreachable it waits for 40 sec. - known as node monitor grace period. After marking it unreachable, it waits for 5 min for the Node to be back. If nodes does not reinstate, it removes the PODs from that node to healthy node if pods are part of the replicaset.
It monitors the number of pods running in nodes and maintains the desired number of pods in running state, if one pods dies , it created another one to keep the total number maintained.
There are many more controllers running as part of kubernetes controller - like Job Controller, Namespace controller, endpoint controller, Deployment Controller,Service Account Controller etc.
Kubernetes Controller Manager packages all controllers. Once you install Kubernetes controller manager, all controllers are installed. You can download kubernetes controller manager from the kubernetes page and install and run it as a service. If you use kubeadm tool to setup, the tool setup controller manager in master node under kube-system namespace and the definition file is located at /etc/kubernetes/manifests/kube-controller-manager.yaml. However setting it with non admin tool, this file is located under /etc/systemd/system/kube-controller-manager.service Once it is running in the master node, you can view it running following command ps -aux | grep kube-controller-manager
Next