In the Kubernetes we can create multiple schedulers by different way.
Deploy additional Scheduler by using definition file (yaml)
Depoly as Pod by using (pod template and scheduler config file)
# Pod TemplateapiVersion:v1kind:Podmetadata:name:custom-schedulernamespace:kube-systemspec:# add this to specify scheduler name we use on PodschedulerName:default-schedulercontainers: - command: - /usr/local/bin/kube-scheduler - --config=/etc/kubernetes/my-scheduler/my-scheduler-config.yaml# (path to store config) name:<scheduler_name>image:<image_scheduler>
# Scheduler Config FileapiVersion:kubescheduler.config.k8s.io/v1kind:KubeSchedulerConfigurationprofiles: - schedulerName:<scheduler_name># we can have multiple profile in priority which scheduler will be run # depend on the condition - schedulerName:default-scheduler - schedulerName:no-scoring-schedulerplugins:preScore:disabled: - name:'*'score:disabled: - name:'* # Optional when we have multiple scheduler run on multiple master node # This is leader which scheduler will be run first leaderElection: leaderElect: true resourceNamespace: kube-system resourceName: lock-object-my-scheduler