WEBVTT

00:00.377 --> 00:04.010
Let's go over the practice test
for our multiple schedulers.

00:04.890 --> 00:07.320
What is the name of the pod that deploys

00:07.400 --> 00:10.120
the default Kubernetes scheduler
in this environment?

00:10.830 --> 00:15.160
Let's do a kubectl get pods command

00:18.240 --> 00:19.760
in the kube system namespace.

00:19.840 --> 00:21.060
We're going to look here.

00:21.580 --> 00:26.570
We see the pod
is kube-scheduler-controlplane.

00:27.850 --> 00:30.010
Let's select that.

00:32.150 --> 00:35.480
What is the image used
to deploy the Kubernetes scheduler?

00:35.560 --> 00:38.280
Inspect the kube scheduler pod
and identify the image.

00:38.690 --> 00:46.020
Let's do a kubectl
describe pod scheduler

00:46.100 --> 00:51.230
and then specify
the namespace as kube system.

00:51.970 --> 00:56.000
Here we have the image and that is

00:56.080 --> 00:59.570
k8s.gcr.io/kubescheduler:

00:59.650 --> 01:02.500
version 1.23.0, as of this recording.

01:02.580 --> 01:03.870
I'm going to select that.

01:11.090 --> 01:14.880
Now, we've already created
the ServiceAccount and ClusterRoleBinding

01:14.960 --> 01:17.820
that our custom scheduler
will make use of.

01:17.900 --> 01:19.620
All of these are already created.

01:19.700 --> 01:21.090
If you like to take a look,

01:21.170 --> 01:26.900
you can do a kubectl
get service account my-scheduler.

01:34.050 --> 01:39.410
We see that my-scheduler service
account in the kube system namespace.

01:39.490 --> 01:42.380
Similarly, there are cluster
role bindings as well.

01:43.330 --> 01:44.510
That's already done for us,

01:44.590 --> 01:49.280
so we don't have to worry about that.
Let's go forward.

01:50.600 --> 01:55.460
Let's create a ConfigMap that
the new scheduler will employ

01:55.540 --> 01:59.460
using the concept
of ConfigMap as a volume.

01:59.540 --> 02:03.530
We have to create a ConfigMap with
the name using the contents of the file.

02:03.610 --> 02:09.500
There's already a file here,
and this is a configuration

02:09.580 --> 02:14.280
that will be passed
through to the new scheduler

02:14.360 --> 02:16.750
that we're going to create.

02:16.830 --> 02:19.080
The file is there, we just have
to create a ConfigMap for it.

02:19.160 --> 02:22.680
We'll do a kubectl create configmap.

02:27.400 --> 02:28.990
The name will be--

02:31.810 --> 02:33.260
let's copy and paste.

02:36.280 --> 02:39.400
It has to be created from file.

02:40.220 --> 02:43.970
We use the form file
as the path to the file

02:44.490 --> 02:48.840
and also specify the name system.

02:50.360 --> 02:53.080
This may be kube system.

02:54.200 --> 02:55.480
There is no name.

03:00.040 --> 03:02.690
Let's verify that it's created.

03:07.480 --> 03:10.900
It's in the kube system namespace.

03:11.710 --> 03:13.370
That's created.

03:17.020 --> 03:18.770
Click Next.

03:18.850 --> 03:21.010
I deploy an additional
scheduler to the cluster

03:21.090 --> 03:23.180
following the given specification

03:23.260 --> 03:27.520
used to manifest file provided
at root my-scheduler.

03:28.200 --> 03:31.590
There's already a file given for us

03:31.670 --> 03:38.590
that's at root my-scheduler.yaml

03:39.110 --> 03:42.600
or just since we're already
in that directory,

03:42.680 --> 03:44.130
you could just give the file name.

03:45.450 --> 03:48.940
We see that most of the work
is already done, the liveness probe,

03:49.020 --> 03:50.540
the readiness probes are all set,

03:50.620 --> 03:53.280
so we don't really have
to worry about that.

03:53.360 --> 03:57.880
All we need to do is add
this image that's given here,

03:57.960 --> 04:02.780
and we have to use the same image
that's used by the current scheduler.

04:03.060 --> 04:04.490
Let's find that out first.

04:04.830 --> 04:08.760
Let's do a kubectl get pods -a.

04:08.840 --> 04:11.660
This is current scheduler.

04:13.070 --> 04:14.600
Let's do a describe

04:16.440 --> 04:24.110
and the system and the script
for the image.

04:24.590 --> 04:33.650
Let's get this image ID, and we're
going to put that in the file

04:33.730 --> 04:35.680
instead of this placeholder here.

04:43.410 --> 04:44.990
If you look at the rest of the file,

04:45.070 --> 04:50.130
it already has
the ConfigMap that we created.

04:51.150 --> 04:56.570
If you scroll down, you'll see
there is the ConfigMap that we created.

04:56.650 --> 04:59.170
That's already configured,
and that basically passes

04:59.250 --> 05:01.810
through as a volume mount here.

05:01.890 --> 05:06.050
We'll talk about ConfigMaps
in the upcoming lectures

05:06.130 --> 05:08.680
if you haven't already
gone through that yet.

05:15.270 --> 05:17.430
We're going to create this.

05:20.910 --> 05:23.770
Let's verify that it's created,

05:26.510 --> 05:27.640
the kube-system namespace.

05:27.720 --> 05:29.800
We have my-scheduler here.

05:30.450 --> 05:31.870
Let's check.

05:32.490 --> 05:33.780
That's done.

05:34.820 --> 05:36.980
The final step is to create a pod.

05:38.190 --> 05:39.780
There's already a pod
definition file given

05:39.860 --> 05:43.020
and use it to create a pod
with a new custom scheduler.

05:43.530 --> 05:48.760
Here we have
the nginx pod definition file.

05:48.840 --> 05:50.390
This is pretty straightforward.

05:50.470 --> 05:54.100
Just nginx pod with the nginx image.

05:54.180 --> 05:56.330
What we need to do
is specify the custom scheduler

05:56.410 --> 05:58.600
which is basically
my-scheduler given here.

05:59.510 --> 06:01.340
As we learned in the lecture,

06:01.420 --> 06:06.510
you have to add a new field here

06:06.960 --> 06:12.250
called schedulerName,

06:12.330 --> 06:17.720
and then we specify the name
of the scheduler we just created.

06:17.800 --> 06:25.330
Save that, and then we create a pod

06:25.410 --> 06:29.400
and we make sure pod is running.

06:31.954 --> 06:33.130
That's it.

06:33.210 --> 06:34.900
That's the end of this lab.

