- The
Controller-Manager is like an office or main compartment in the master ship.
- Taking and monitoring necessary actions for when a new ship arrives.
- Another office can be one that manages the containers on the ships or manages the ships when they leave.
- Continuously on the look out regarding the status of the ship.
- Takes necessary actions to remediate the situation.
- In Kubernetes terms, the
Controller is a process that continuously monitors the state of components within a system and works together to make sure the system is in the desired functioning state.
- For example, the
Node-Controller is responsible for monitoring the status of the nodes and takes the necssary actions to keep the applications running. This is done via the kube-apiserver

- The
node-controller checks the status of the nodes every 5 seconds.
- That allows the
node-controller to monitor the health of the nodes.
- If the heartbeat stops from a node, the node is marked as unreacheable.
- This is a period of 40 seconds.

- After a node is marked as unreacheable, it is provided 5 minutes to come back up.
- If it does not, the
Node-Controller removes the pods assigned to that node and provisions the pods onto a health node, if the pods are part of a replica set.

- The next controller is the
Replication-Controller.
- Responsible for monitoring the state of replication sets and ensures the desired number of pods are available at all times within the set.

- If a pod dies, the
Replication-Controller creates another one.
- There are many more
Controllers within Kubernetes.

- Whatever concepts we have seen so far such as deployments, services, namespaces, persistent volumes, this intelligence is built into the controllers.
- This is the brain behind a lot of things in Kubernetes.
- How can you see these controllers and where are they located in the cluster?
- They are all packaged into a single process called the
Kube-Controller-Manager. When you install the Kube-Controller-Manager, the different controllers are installed as well.
- How do you install and view the
Kube-Controller-Manager?

- When you install the
Kube-Controller-Manager, the different controllers get installed as well.
- How to install the
kube-controller-manager, which you can grab from the Kubernetes release page.

- Then run it as a service, which is the
kube-controller-manager.service and you will see a list of options provided.

- The
node-monitor-period, node-monitor-grace-period and node-eviction-timeout go in the kube-controller-manager.service configuration as options.

- There is an additional option called
--controllers, where you can specify which controllers to enable.

- By default, all of the controllers are enabled, however you can choose a select few to use.
- If any of the Controllers do not work or do not exist, the following configuration would be a good starting point to look at.

- How do you view
kube-controller-manager server options? - This depends on how you set up your cluster.
- If you set it up with the
kubeadm tool, the kube-controller-manager is deployed as a pod in the kube (Kubernetes System) namespace in the Master Node.

- In a none
kubeadm setup, you can see the options located in the pod definition file, which is in the manifests directory.
/etc/kubernetes/manifests/kube-controller-manager.yaml

- You can also see the running process and the effective options on the Master Node. Using something like
ps -aux | grep kube-controller-manager
