WEBVTT

00:01.070 --> 00:04.130
Hello and welcome to this lecture. In this lecture

00:04.130 --> 00:10.910
we will talk about Kube Controller Manager. As we discussed earlier, the kube controller manager manages

00:10.970 --> 00:17.920
various controllers in Kubernetes. A controller is like an office or department within the master ship

00:17.980 --> 00:23.890
that have their own set of responsibilities. Such as an office for the Ships would be responsible for

00:23.890 --> 00:26.960
monitoring and taking necessary actions about the ships.

00:27.010 --> 00:32.110
Whenever a new ship arrives or when a ship leaves or gets destroyed another office could be one that

00:32.110 --> 00:37.700
manages the containers on the ships they take care of containers that are damaged or full of ships.

00:37.780 --> 00:45.480
So these officers are number 1, continuously on the lookout for the status of the ships and 2, take

00:45.520 --> 00:50.700
necessary actions to remediate the situation. In the kubernetes terms

00:50.880 --> 00:56.730
a controller is a process that continuously monitors the state of various components within the system

00:57.090 --> 01:01.670
and works towards bringing the whole system to the desired functioning state.

01:01.710 --> 01:07.770
For example the node controller is responsible for monitoring the status of the nodes and taking necessary

01:07.770 --> 01:10.610
actions to keep the application running.

01:10.620 --> 01:13.420
It does that through the kube-api server.

01:13.590 --> 01:17.550
The node controller checks the status of the nodes every 5 seconds.

01:17.550 --> 01:22.800
That way the node controller can monitor the health of the nodes if it stops receiving heartbeat from

01:22.800 --> 01:31.460
a node the node is marked as unreachable but it waits for 40 seconds before marking it unreachable after

01:31.460 --> 01:38.280
a node is marked unreachable it gives it five minutes to come back up if it doesn’t, it removes the

01:38.280 --> 01:42.890
PODs assigned to that node and provisions them on the healthy ones.

01:42.990 --> 01:48.980
If the PODs are part of a replica set the next controller is the replication controller.

01:49.030 --> 01:54.520
It is responsible for monitoring the status of replica sets and ensuring that the desired number of

01:54.520 --> 01:58.240
PODs are available at all times within the set.

01:58.300 --> 02:01.800
If a pod dies it creates another one.

02:01.850 --> 02:04.960
Now those were just two examples of controllers.

02:05.000 --> 02:08.990
There are many more such controllers available within kubernetes.

02:08.990 --> 02:15.180
Whatever concepts we have seen so far in kubernetes such as deployments, Services, namespaces,

02:15.180 --> 02:21.890
persistent volumes and whatever intelligence is built into these constructs it is implemented through

02:21.890 --> 02:23.740
these various controllers.

02:23.900 --> 02:29.240
As you can imagine this is kind of the brain behind a lot of things in kubernetes.

02:29.480 --> 02:34.330
Now how do you see these controllers and where are they located in your cluster.

02:34.380 --> 02:39.460
They're all packaged into a single process known as kubernetes controller manager.

02:39.670 --> 02:45.150
When you install the kubernetes controller manager the different controllers get installed as well.

02:45.250 --> 02:47.140
So how do you install and view the kubernetes

02:47.140 --> 02:53.200
Controller manager download the kube-controller-manager from the kubernetes release page. Extract it and

02:53.200 --> 02:54.550
run it as a service.

02:54.700 --> 03:01.060
When you run it as you can see there are a list of options provided this is where you provide additional

03:01.060 --> 03:03.590
options to customize your controller.

03:03.610 --> 03:08.810
Remember some of the default settings for node controller we discussed earlier such as the node monitor

03:08.810 --> 03:12.490
period the grace period and the eviction  timeout.

03:12.490 --> 03:15.700
These go in here as options.

03:15.700 --> 03:20.890
There is an additional option called controllers that you can use to specify which controllers to enable.

03:21.490 --> 03:22.390
By default

03:22.390 --> 03:27.110
all of them are enabled but you can choose to enable a select few.

03:27.210 --> 03:32.890
So in case any of your controllers don't seem to work or exist this would be a good starting point to

03:32.890 --> 03:33.190
look at.

03:34.400 --> 03:37.370
So how do you view the Kube-controller-manager server options?

03:37.370 --> 03:39.540
Again it depends on how you set up your cluster.

03:39.560 --> 03:45.170
If you set it up with kubeadm tool, kubeadm deploys the kube-controller-manager as a pod in the

03:45.170 --> 03:51.350
kube-system namespace on the master node. You can see the options within the pod definition file located

03:51.350 --> 03:57.980
at etc kubernetes manifests folder. In a non-kubeadm setup, you can inspect the options by viewing

03:57.980 --> 04:02.460
the kube-controller-manager service located at the services directory.

04:02.510 --> 04:07.760
You can also see the running process and the effective options by listing the process on the master

04:07.760 --> 04:10.610
node and searching for kube-controller-manager.

04:11.430 --> 04:14.910
Well that's it for this lecture and I will see you in the next.

