Manual Scheduling
Labels & Selectors
Taints and Toleration
Node Selectors
Node Affinity
Resources Requirement & Limit
DaemonSets
Static Pods
Multiple Scheduler
ref: https://kubernetes.io/docs/tasks/extend-kubernetes/configure-multiple-schedulers/
Deploy Additional Scheduler
Each scheduler uses a separate configuration file and with each file having its own scheduler name. This is not how you would deploy a cusstom scheduler 99% of the time today because with kubeadm deployment, all the control plane component run as a pod or a deployment within the kubernetes cluster.
Deploy Additional Scheduler As a Pod
pod definition for custom scheduler
|
|
Exercise
Questions
- What is the name of the POD that deploys the default kubernetes scheduler in this environment?
- What is the image used to deploy the kubernetes scheduler?
- Let’s create a configmap that the new scheduler will employ using the concept of ConfigMap as a volume.
We have already given a configMap definition file called
my-scheduler-configmap.yaml
|
|
at /root/ path that will create a configmap with name my-scheduler-config using the content of file /root/my-scheduler-config.yaml.
4. Deploy an additional scheduler to the cluster following the given specification Use the manifest file provided at /root/my-scheduler.yaml.
|
|
Use the same image as used by the default kubernetes scheduler. 5. a POD definition file is given. Use it to create a POD with the new custom scheduler.
|
|
Solution
- run
k get pods -n kube-system->kube-scheduler-controlplane
- run
k describe pod kube-scheduler-controlplane - run
kubectl create configmap my-scheduler-config --from-file=/root/my-scheduler-config.yaml -n kube-system, then check the result by runningk get configmap my-scheduler-config -n kube-system - steps
- check the image from pod using
k describe pod kube-scheduler-controlplane -n kube-system | grep Image - copy the image to the yaml file
- run
k create -f my-scheduler.yaml
- edit the yaml file
|
|
and run k apply -f nginx-pod.yaml