Let's go over the practice test for our multiple schedulers.
What is the name of the pod that deploys
the default Kubernetes scheduler in this environment?
Let's do a kubectl get pods command
in the kube system namespace.
We're going to look here.
We see the pod is kube-scheduler-controlplane.
Let's select that.
What is the image used to deploy the Kubernetes scheduler?
Inspect the kube scheduler pod and identify the image.
Let's do a kubectl describe pod scheduler
and then specify the namespace as kube system.
Here we have the image and that is
k8s.gcr.io/kubescheduler:
version 1.23.0, as of this recording.
I'm going to select that.
Now, we've already created the ServiceAccount and ClusterRoleBinding
that our custom scheduler will make use of.
All of these are already created.
If you like to take a look,
you can do a kubectl get service account my-scheduler.
We see that my-scheduler service account in the kube system namespace.
Similarly, there are cluster role bindings as well.
That's already done for us,
so we don't have to worry about that. Let's go forward.
Let's create a ConfigMap that the new scheduler will employ
using the concept of ConfigMap as a volume.
We have to create a ConfigMap with the name using the contents of the file.
There's already a file here, and this is a configuration
that will be passed through to the new scheduler
that we're going to create.
The file is there, we just have to create a ConfigMap for it.
We'll do a kubectl create configmap.
The name will be--
let's copy and paste.
It has to be created from file.
We use the form file as the path to the file
and also specify the name system.
This may be kube system.
There is no name.
Let's verify that it's created.
It's in the kube system namespace.
That's created.
Click Next.
I deploy an additional scheduler to the cluster
following the given specification
used to manifest file provided at root my-scheduler.
There's already a file given for us
that's at root my-scheduler.yaml
or just since we're already in that directory,
you could just give the file name.
We see that most of the work is already done, the liveness probe,
the readiness probes are all set,
so we don't really have to worry about that.
All we need to do is add this image that's given here,
and we have to use the same image that's used by the current scheduler.
Let's find that out first.
Let's do a kubectl get pods -a.
This is current scheduler.
Let's do a describe
and the system and the script for the image.
Let's get this image ID, and we're going to put that in the file
instead of this placeholder here.
If you look at the rest of the file,
it already has the ConfigMap that we created.
If you scroll down, you'll see there is the ConfigMap that we created.
That's already configured, and that basically passes
through as a volume mount here.
We'll talk about ConfigMaps in the upcoming lectures
if you haven't already gone through that yet.
We're going to create this.
Let's verify that it's created,
the kube-system namespace.
We have my-scheduler here.
Let's check.
That's done.
The final step is to create a pod.
There's already a pod definition file given
and use it to create a pod with a new custom scheduler.
Here we have the nginx pod definition file.
This is pretty straightforward.
Just nginx pod with the nginx image.
What we need to do is specify the custom scheduler
which is basically my-scheduler given here.
As we learned in the lecture,
you have to add a new field here
called schedulerName,
and then we specify the name of the scheduler we just created.
Save that, and then we create a pod
and we make sure pod is running.
That's it.
That's the end of this lab.