Hello and welcome to this lecture. In this lecture
we will talk about Kube Controller Manager. As we discussed earlier, the kube controller manager manages
various controllers in Kubernetes. A controller is like an office or department within the master ship
that have their own set of responsibilities. Such as an office for the Ships would be responsible for
monitoring and taking necessary actions about the ships.
Whenever a new ship arrives or when a ship leaves or gets destroyed another office could be one that
manages the containers on the ships they take care of containers that are damaged or full of ships.
So these officers are number 1, continuously on the lookout for the status of the ships and 2, take
necessary actions to remediate the situation. In the kubernetes terms
a controller is a process that continuously monitors the state of various components within the system
and works towards bringing the whole system to the desired functioning state.
For example the node controller is responsible for monitoring the status of the nodes and taking necessary
actions to keep the application running.
It does that through the kube-api server.
The node controller checks the status of the nodes every 5 seconds.
That way the node controller can monitor the health of the nodes if it stops receiving heartbeat from
a node the node is marked as unreachable but it waits for 40 seconds before marking it unreachable after
a node is marked unreachable it gives it five minutes to come back up if it doesn’t, it removes the
PODs assigned to that node and provisions them on the healthy ones.
If the PODs are part of a replica set the next controller is the replication controller.
It is responsible for monitoring the status of replica sets and ensuring that the desired number of
PODs are available at all times within the set.
If a pod dies it creates another one.
Now those were just two examples of controllers.
There are many more such controllers available within kubernetes.
Whatever concepts we have seen so far in kubernetes such as deployments, Services, namespaces,
persistent volumes and whatever intelligence is built into these constructs it is implemented through
these various controllers.
As you can imagine this is kind of the brain behind a lot of things in kubernetes.
Now how do you see these controllers and where are they located in your cluster.
They're all packaged into a single process known as kubernetes controller manager.
When you install the kubernetes controller manager the different controllers get installed as well.
So how do you install and view the kubernetes
Controller manager download the kube-controller-manager from the kubernetes release page. Extract it and
run it as a service.
When you run it as you can see there are a list of options provided this is where you provide additional
options to customize your controller.
Remember some of the default settings for node controller we discussed earlier such as the node monitor
period the grace period and the eviction timeout.
These go in here as options.
There is an additional option called controllers that you can use to specify which controllers to enable.
By default
all of them are enabled but you can choose to enable a select few.
So in case any of your controllers don't seem to work or exist this would be a good starting point to
look at.
So how do you view the Kube-controller-manager server options?
Again it depends on how you set up your cluster.
If you set it up with kubeadm tool, kubeadm deploys the kube-controller-manager as a pod in the
kube-system namespace on the master node. You can see the options within the pod definition file located
at etc kubernetes manifests folder. In a non-kubeadm setup, you can inspect the options by viewing
the kube-controller-manager service located at the services directory.
You can also see the running process and the effective options by listing the process on the master
node and searching for kube-controller-manager.
Well that's it for this lecture and I will see you in the next.