Skip to main content
This guide explains how to run multiple schedulers in a Kubernetes cluster, why you might need them, and how to deploy a custom scheduler alongside the default kube-scheduler. Kubernetes includes a default scheduler (usually default-scheduler) that places Pods onto nodes while honoring constraints such as taints/tolerations and node affinity. For specialized placement logic—custom scoring, additional validation, or entirely different scheduling algorithms—you can run one or more additional scheduler processes (or Pods) with unique names. Applications request a specific scheduler by setting the schedulerName field in their Pod spec.
An illustrated infographic using ships and a dock to explain Kubernetes scheduling, showing a Master and Worker Nodes with labeled schedulers (my-scheduler, my-scheduler-2, kube-scheduler) and colorful container stacks. Green callouts and crane icons connect the dock to the containers to represent scheduling and deployment.

How Pods select a scheduler

Set the scheduler to use in the Pod spec with schedulerName:
If schedulerName is omitted, the default scheduler (commonly default-scheduler) handles the Pod.

Scheduler configuration: minimal example

Each scheduler process needs a configuration with a unique schedulerName. A minimal kube-scheduler configuration:
Each scheduler instance should run with its own config file referencing the chosen schedulerName.

Deployment options

You can run an additional scheduler in several ways:
  • As a standalone Pod in kube-system (simple, useful for testing).
  • As a Deployment (recommended for production—pack the scheduler binary into a container image).
  • As a static Pod or system component if you manage control-plane manifests directly.
Table: Quick comparison

Run as a standalone Pod

Example Pod manifest that runs the upstream kube-scheduler binary and points to a kubeconfig and scheduler config:
Be sure to create the referenced ConfigMap and kubeconfig before applying the Pod manifest.

Leader election (high availability)

When running multiple replicas of the same scheduler (for HA), enable leader election so only one replica makes scheduling decisions at any time. Configure leader election in the kube-scheduler configuration:
If you deploy only a single replica of your custom scheduler, you may set leaderElect: false. For HA deployments with multiple replicas, always enable leader election and give each scheduler deployment a unique resourceName so locks do not conflict.
Typical steps:
  1. Build or package the scheduler binary into a container image.
  2. Push the image to your registry (GCR, Docker Hub, etc.).
  3. Create a ServiceAccount and ClusterRoleBinding so the scheduler can access the API.
  4. Provide the scheduler configuration via a ConfigMap and mount it into the Deployment.
  5. Enable leader election for HA.
Example build and push (condensed):
Condensed Deployment manifest (key fields):
ConfigMap with the scheduler configuration (example):
RBAC essentials (ServiceAccount + ClusterRoleBinding):
Notes:
  • Mount the ConfigMap into the Deployment and pass --config to the scheduler command.
  • Use a ServiceAccount and ClusterRoleBinding so the scheduler can authenticate and perform scheduling operations.

Apply and verify

Create the Deployment/Pod and supporting resources:
You should see your custom scheduler Pod(s) running in kube-system (names will vary based on whether you used a Pod or Deployment manifest).

Scheduling a Pod with the custom scheduler

Create a Pod that requests your scheduler:
Apply:
If the Pod stays in Pending, inspect it:
Look for scheduling events and reasons in the Events section.

Confirm which scheduler scheduled the Pod

Events show the scheduler that assigned the Pod. Example:
Sample output:
The SOURCE column shows the scheduler that created the Scheduled event.

Inspect scheduler logs

If scheduling does not behave as expected, view the scheduler Pod logs:
Example log snippet:
Logs will show version, leader election, cache syncs, and any scheduling errors or plugin messages.

Troubleshooting tips

  • If your Pod never leaves Pending, check kubectl describe pod <pod> and events for reasons.
  • Confirm the scheduler Pod is healthy (readiness/liveness probes) and has the correct --config and --kubeconfig flags.
  • Verify RBAC (the scheduler’s ServiceAccount must have system:kube-scheduler privileges or equivalent).
  • Ensure leader election settings use unique resourceName values if you run multiple distinct scheduler deployments.

Summary

  • Kubernetes supports multiple schedulers; each must have a unique schedulerName.
  • Run additional schedulers by starting kube-scheduler (or a custom scheduler) with its own configuration and kubeconfig.
  • Request a specific scheduler in a Pod spec with schedulerName.
  • For HA, enable leader election and use unique lock names per scheduler deployment.

Watch Video

Practice Lab