This doc tells about how to run multiple scheduler. But I m not able to understand how does default scheduler is decided? Is it based on --leader-elect
option?
Can I tell Kubernetes to use my-custom-scheduler as default scheduler instead of kube-scheduler?
Is there another way to specify scheduler other than schedulerName
in Pod/Deployment spec.
No it's not based on
--leader-elect
which is to run multiple replicated copy of the same scheduler with leader election enabled so that only one replica acts as leader at any given point in time.You don't need to change the default scheduler at the kubernetes cluster level because you can tell kubernetes to use your custom scheduler in the pod spec. An example below using
my-scheduler
instead ofdefault-scheduler
Above pod will be scheduled by
my-scheduler
instead of default kube-scheduler. If you omit theschedulerName
then it will be scheduled by default kube-schedulerFrom the doc
So you could just replace the existing kube scheduler with your scheduler with name
default-scheduler
./etc/kubernetes/manifests/kube-scheduler.yaml
or