Configuring node scoring for the scheduling service
You can adjust the node scoring configuration for the scheduling service if you want to have more control over where the IBM Cloud Pak for Data scheduling service schedules pods.
- Who needs to complete this task?
- A cluster administrator must complete this task.
- When do you need to complete this task?
- This task applies only if you installed the scheduling service.
Complete this task if you want to override the default pod scheduling behavior of the scheduling service.
Important: The node scoring configuration will impact all instances of Cloud Pak for Data on the cluster.
Before you begin
Ensure that you source the environment variables before you run the commands in this task.
About this task
The scheduling service is based on the default Kubernetes scheduler.
When the Kubernetes scheduler needs to schedule a pod, it uses node scoring to determine which node to schedule the pod on. The Kubernetes scheduler includes several plug-ins. Each plug-in has a weight that factors into the node score. The pod is scheduled on the node with the highest score.
| Kubernetes scheduler plug-in | Default weight |
|---|---|
TaintToleration |
3 |
InterPodAffinity |
2 |
NodeAffinity |
2 |
PodTopologySpread |
2 |
ImageLocality |
1 |
NodeResourcesBalancedAllocation |
1 |
NodeResourcesFit |
1 |
The Cloud Pak for Data
scheduling service includes a parameter called
nodePreference. The Cloud Pak for Data
scheduling service looks at the node scores
based on the following plug-ins:
TaintTolerationInterPodAffinityNodeAffinityPodTopologySpreadImageLocality
If the score for two nodes is the same, the nodePreference parameter acts as a
tiebreaker.
By default, the Cloud Pak for Data
scheduling service is configured to give more
weight to nodes with the lowest amount of allocated CPU (LessCPURequest). This
setting causes pods to spread out across nodes.
You can configure the nodePreference parameter to use a different dimension or
to use multiple dimensions. The configuration that you use determines whether pods are spread out
across nodes or whether the pods are packed on a subset of the nodes.
- Settings that spread pods out across nodes
-
Option Dimension LessCPURequestNodes with less allocated CPU (more available CPU) score higher. The available CPU is determined by pod requests. LessMemRequestNodes with less allocated memory (more available memory) score higher. The available memory is determined by pod requests. LessCPULimitNodes with less allocated CPU (more available CPU) score higher. The available CPU is determined by pod limits. LessMemLimitNodes with less allocated memory (more available memory) score higher. The available memory is determined by pod limits. You can also combine options. For example:
Options Dimension LessCPURequest LessMemRequestThe score for each node is based on the average of the available CPU and available memory. The available resources are determined by pod requests. LessCPULimit LessMemLimitThe score for each node is based on the average of the available CPU and available memory. The available resources are determined by pod limits. - Settings that pack pods on a subset of the nodes
-
Option Dimension MoreCPURequestNodes with more allocated CPU score higher. The available CPU is determined by pod requests. MoreMemRequestNodes with more allocated memory score higher. The available memory is determined by pod requests. MoreCPULimitNodes with more allocated CPU score higher. The available CPU is determined by pod limits. MoreMemLimitNodes with more allocated memory score higher. The available memory is determined by pod limits. You can also combine options. For example:
Options Dimension MoreCPURequest MoreMemRequestThe score for each node is based on the average of the allocated CPU and allocated memory. The available resources are determined by pod requests. MoreCPULimit MoreMemLimitThe score for each node is based on the average of the allocated CPU and allocated memory. The available resources are determined by pod limits.
Procedure
To configure node scoring for the Cloud Pak for Data scheduling service: