2.12 Configuring Scheduler Profiles
Kubernetes Scheduler Profiles let you run multiple logical schedulers inside a single scheduler binary. Each profile behaves like an independent scheduler but shares the same process β reducing operational overhead and avoiding race conditions between multiple scheduler instances.
Info
Scheduler Profiles were introduced in Kubernetes v1.18+.
Why Scheduler Profiles
Before Scheduler Profiles, running multiple schedulers required:
- Separate scheduler binaries
- Separate configuration files
- Separate running processes
This led to:
- Higher maintenance overhead
- More resource usage
- Possible race conditions between schedulers
Note
Scheduler Profiles allow multiple scheduler behaviors inside one scheduler process instead of running multiple scheduler services.
What Is a Scheduler Profile
A Scheduler Profile is a configuration block inside the scheduler configuration file that defines:
- A unique scheduler name
- Plugin configuration
- Extension point behavior
Each profile:
- Acts like a separate logical scheduler
- Uses the same
kube-schedulerbinary - Can behave differently through plugin settings
How Pods Choose a Scheduler Profile
Pods select which scheduler profile to use with the schedulerName field.
apiVersion: v1
kind: Pod
metadata:
name: example-pod
spec:
schedulerName: my-scheduler-2
containers:
- name: nginx
image: nginx
If schedulerName is not specified, the default profile (default-scheduler) is used.
Scheduler Profiles β Concept Diagram
ββββββββββββββββββββββββββββββββ
β kube-scheduler β
β (single binary) β
ββββββββββββββββ¬ββββββββββββββββ
β
ββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
ββββββββββββββββββββ ββββββββββββββββββββ ββββββββββββββββββββ
β Profile A β β Profile B β β Profile C β
β schedulerName: β β schedulerName: β β schedulerName: β
β default-schedulerβ β my-scheduler-2 β β my-scheduler-3 β
β β β β β β
β Default plugins β β Custom plugins β β Scoring disabled β
ββββββββββββββββββββ ββββββββββββββββββββ ββββββββββββββββββββ
β β β
βΌ βΌ βΌ
Pods without Pods with Pods with
schedulerName schedulerName=my-scheduler-2 schedulerName=my-scheduler-3
Configuring Multiple Profiles
Multiple profiles are defined under the profiles section in the scheduler configuration.
Example Configuration
apiVersion: kubescheduler.config.k8s.io/v1
kind: KubeSchedulerConfiguration
profiles:
- schedulerName: my-scheduler-2
plugins:
score:
disabled:
- name: TaintToleration
enabled:
- name: MyCustomPluginA
- name: MyCustomPluginB
- schedulerName: my-scheduler-3
plugins:
preScore:
disabled:
- name: "*"
score:
disabled:
- name: "*"
- schedulerName: my-scheduler-4
Tip
Each profile can enable or disable plugins independently to change scheduling behavior.
Scheduler Extension Points
Scheduler plugins run at different extension points during the scheduling cycle.
Scheduling Flow Diagram
Pod Enters Queue
β
βΌ
ββββββββββββββββ
β Queue Sort β β Example: PrioritySort
ββββββββ¬ββββββββ
βΌ
ββββββββββββββββ
β Filtering β β NodeResourcesFit, NodeAffinity, TaintToleration
ββββββββ¬ββββββββ
βΌ
ββββββββββββββββ
β Scoring β β ImageLocality, NodeResourcesFit
ββββββββ¬ββββββββ
βΌ
ββββββββββββββββ
β Binding β β DefaultBinder
ββββββββββββββββ
Major Extension Points
queueSort- Controls Pod ordering
- Example: PrioritySort
preFilter,filter,postFilter- Removes unsuitable nodes
- Examples: NodeResourcesFit, NodeAffinity, TaintToleration
preScore,score,reserve- Ranks remaining nodes
- Examples: ImageLocality, NodeResourcesFit
permit,preBind,bind,postBind- Final node assignment
- Example: DefaultBinder
Plugin Customization Per Profile
Each scheduler profile can customize plugins independently.
You can:
- Enable specific plugins
- Disable specific plugins
- Disable all plugins using
"*" - Use custom plugins
- Change filtering and scoring behavior
Tip
Profiles mainly differ by plugin configuration, not just scheduler name.
Key Takeaways
Summary
- Scheduler Profiles run multiple logical schedulers in one binary
- Each profile has a unique
schedulerName - Pods select profiles using
schedulerName - Profiles customize plugin behavior
- Reduces operational overhead
- Avoids multi-scheduler race conditions