Certified Kubernetes Administrator Study Guide – Scheduling – Understand how to run multiple schedulers and how to configure pods to use them

Kubernetes ships with the default scheduler however it is possible to run multiple schedulers, including custom created schedulers, alongside each other and tell Kubernetes which one to use for your pods.

Steps to run a second scheduler:

  1. Create container image for the new scheduler
  2. Create spec for the container for deploying onto your cluster. Best practice is to run it inside a deployment so that it benefits from availability. The spec must contain a unique name for the new scheduler as the value passed to the command run inside the container to create the new scheduler and assign a service account bound to the cluster role system:kube-scheduler to grant it the same privileges as the default scheduler.
  3. Deploy the deployment

When deploying pods the scheduler chosen depends on the use of the schedulerName: value in the spec of the pod.

  1. If the schedulerName: value is not set then the default scheduler is used as per normal
  2. If the schedulerName: value is set to default-scheduler then the default scheduler is used
  3. If the schedulerName: value is set to the name provided to the command in the second scheduler spec then the second scheduler is used

You can check which scheduler was used to schedule a pod using the scheduled entries in the event logs

kubectl get events

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close