Due to the fact that Kubernetes’ default scheduler does not meet our requirements, we need to implement target load scheduling, which is a second development based on the scheduler-plugins scheduler.
Through the official documentation, we understand that Kubernetes supports retaining the default scheduler while also installing a custom scheduler, and supports running multiple schedulers simultaneously. You can specify which scheduler to use for pod scheduling; if not specified, the default scheduler is used.
From the documentation of scheduler-plugins, we learn that the load-aware scheduling plugin of scheduler-plugins requires us to disable the two default scoring plugins, NodeResourcesLeastAllocation and NodeResourcesBalancedAllocation (default plugins at the Scoring extension point). Hence, the question arises: when a custom scheduler in Kubernetes disables a certain scoring plugin, does it affect the default scheduler, and will the default scheduler also disable this scoring plugin?
apiVersion: kubescheduler.config.k8s.io/v1
kind: KubeSchedulerConfiguration
leaderElection:
leaderElect: false
profiles:
- schedulerName: scheduler-plugins
plugins:
multiPoint:
enabled:
- name: TargetLoadPacking
disabled:
- name: NodeResourcesLeastAllocated
- name: NodeResourcesBalancedAllocation
pluginConfig:
- name: TargetLoadPacking
......
Let’s start with the conclusion: It will not affect the default scheduler; it will only affect the scheduler-plugins scheduler itself. The default scheduler will not change due to the configuration of the custom scheduler.
The order of plugin invocation is as follows:
- If a scheduler does not have a plugin configured for a certain extension point, the scheduler will use the default plugin for that extension point.
- If a new plugin is configured and activated for a certain extension point of a scheduler, the scheduler will first call the default plugin for that extension point, and then call the newly configured plugin.
The default plugins for default extension points are always called first, followed by the custom scheduler (KubeSchedulerConfiguration) configuring and activating (enabled) plugins for the extension point, and then calling the activated (enabled) plugins in order.
If necessary, we can change the order in which the default plugin is called by first disabling (disabled) the default plugin and then adding the default plugin at a certain position in the activation (enabled) list.