All Products
Search
Document Center

Container Service for Kubernetes:Configure the custom parameters of kube-scheduler

Last Updated:Apr 15, 2024

You can modify the custom parameters of kube-scheduler to manage how the scheduler schedules pods. This topic describes how to configure the custom parameters of kube-scheduler in Container Service for Kubernetes (ACK) clusters.

Prerequisites

An ACK Pro cluster, ACK Edge Pro cluster, or ACK Lingjun cluster that runs Kubernetes 1.20 or later is created. For more information, see Create an ACK managed cluster.

ACK Serverless Pro clusters in which kube-scheduler is installed also support custom kube-scheduler parameters. Only users in the whitelist can create ACK Serverless Pro clusters. For more information, see Create an ACK Serverless cluster.

Limits

The following table describes the kube-scheduler versions that support custom parameters in ACK Pro clusters and ACK Edge Pro clusters that run different Kubernetes versions.

All ACK Serverless Pro clusters and ACK Lingjun clusters in which kube-scheduler is installed support custom parameters.

Kubernetes version

kube-scheduler version

1.28

Supported

1.26

≥ v1.26.3-aliyun-4.1

1.24

≥ 1.24.6-ack-3.1

1.22

≥ 1.22.15-ack-2.0

1.20

≥ v1.20.11-9.0-bcaa6001-aliyun

Procedure

  1. Log on to the ACK console. In the left-side navigation pane, click Clusters.

  2. On the Clusters page, click the name of the cluster that you want to manage and choose Operations > Add-ons in the left-side navigation pane.

  3. On the Core Components tab, find Kube Scheduler and click Configuration in the lower-right corner.

  4. In the Kube Scheduler Parameters dialog box, configure the custom parameters and click OK.

    The features and custom parameters vary based on the kube-scheduler version. For more information about the features supported by different kube-scheduler versions, see kube-scheduler. The following table describes the custom parameters.

    Parameter

    Description

    Data type

    Valid value

    Default value

    podMaxBackoffSeconds

    The maximum backoff delay for rescheduling pods in seconds. After a pod fails to be scheduled, the pod cannot be rescheduled until the delay ends.

    int

    [1,100000]

    10

    Preferably Use Bin Packing During Pod Scheduling (Pods Are Evenly Distributed among Nodes When Unselected)

    Specifies whether to schedule pods based on the binpack algorithm.

    bool

    • false

    • true

    true

    binpackPluginWeight

    The weight of the node score calculated by the binpack plug-in.

    Note

    This parameter takes effect only if you select Preferably Use Bin Packing During Pod Scheduling.

    int

    [1,100000]

    100

    binpackResourceWeight

    The weight of each resource when the binpack plug-in calculates the node score.

    Note

    This parameter takes effect only if you select Preferably Use Bin Packing During Pod Scheduling.

    • resourceName: string

    • resourceWeight: int

    • Schema validation is performed on the resourceName parameter. The value of the resourceName parameter can contain only letters, digits, periods (.), forward slashes (/), and hyphens (-).

    • The value of the resourceWeight parameter must be an integer from 1 to 10000.

    • cpu:1

    • memory:1

    connectionQPS

    The QPS limit of the Kubernetes API server.

    int

    [1,1000]

    50

    connectionBurst

    The burst QPS when the QPS limit of the Kubernetes API server is reached.

    int

    [1,1000]

    100

    percentageOfNodesToScore

    The percentage of nodes suitable for pod scheduling.

    Default value: 0. When the default value is used, a proportion of nodes in the cluster are scored. The proportion ranges from 5% to 50% based on the cluster size.

    int

    [0,100]

    0

    Enable Node Scoring for GPU Sharing (Preferably Share One GPU with Multiple Tasks on One Node)

    Specifies whether to schedule GPU-accelerated pods to GPUs that request more memory and computing power when you use GPU sharing. To use GPU sharing, you must install the cloud-native AI suite.

    bool

    • false

    • true

    true

    Enable Load-aware Scheduling (Unselected by Default)

    To enable load-aware scheduling, you must install the ack-koordinator component.

    bool

    • false

    • true

    false

    loadAwareResourceWeight

    The weights of CPU resources and memory resources for load-aware scheduling. If you do not specify a weight for a resource, the weight is set to 0.

    • resourceName: string

    • resourceWeight: int

    • The schema of the resourceName parameter is verified. The value of resourceName can only be cpu or memory.

    • The value of the resourceWeight parameter must be an integer from 1 to 10000.

    cpu=1

    memory=1

    loadAwareAggregatedUsageAggregationType

    The type of data aggregation for the statistics. Valid values:

    • avg: calculates the average value.

    • p50: calculates 50% of the statistics.

    • p90, p95, and p99: calculates 90% of the statistics, calculates 95% of the statistics, and calculates 99% of the statistics.

    enum

    • p50

    • p90

    • p95

    • p99

    • avg

    avg

The following section describes how to configure custom binpack parameters.

Custom binpack parameters

Comparison between the binpack algorithm and the spread algorithm

Dimension

binpack

spread

Scheduling policy

  • When this algorithm is used, the system preferentially schedules pods to nodes whose resource utilization is high.

  • When this algorithm is used, the system preferentially shares one node with multiple pods.

  • When this algorithm is used, the system preferentially schedules pods to nodes whose resource utilization is the lowest.

  • When this algorithm is used, the system attempts to allocate one node to each pod.

Feature

This algorithm reduces resource fragments on nodes.

  • This algorithm is the default resource scheduling policy of Kubernetes.

  • This algorithm ensures relatively even pod distribution among the nodes in a cluster.

  • This algorithm leads to resource fragments on nodes.

Scenario

Improve resource utilization on nodes.

Guarantee the high availability of nodes.

Configure custom binpack parameters

You can select Preferably Use Bin Packing During Pod Scheduling and specify the weight of the node score calculated by the binpack plug-in. A larger weight indicates a higher probability that pods are scheduled to the same node. You can also specify the resource names based on which the binpack plug-in calculates the node score and the weight of each resource in the node score calculation. A greater value indicates a greater influence on the node score.

  1. Log on to the ACK console. In the left-side navigation pane, click Clusters.

  2. On the Clusters page, click the name of the cluster that you want to manage and choose Operations > Add-ons in the left-side navigation pane.

  3. On the Core Components tab, find Kube Scheduler and click Configuration in the lower-right corner of the card.

  4. On the Kube Scheduler Parameters page, configure the custom parameters.

    1. Select Preferably Use Bin Packing During Pod Scheduling to enable the binpack algorithm.

    2. Set the binpackPluginWeight parameter to specify the weight of the node score calculated by the binpack plug-in. For more information, see binpack weight.

      In most cases, you can use the default settings. If pods are not scheduled as expected after you enable binpack, you can set the weight to a greater value, such as 200.

    3. Specify the resource names based on which the binpack plug-in calculates the node score and the weight of each resource.

      • For more information, see Enabling bin packing using MostAllocated strategy. The name and weight parameters in the scoringStrategy:resources section specify the weight of each resource in the node score calculation section. You can configure the name and weight parameters in the scoringStrategy:resources section.

      • The name and weight parameters in the scoringStrategy:resources section correspond to the resourceName and resourceWeight parameters in the ACK console. You can click Add or Delete to add or delete resources.

      Note

      If you select Preferably Use Bin Packing During Pod Scheduling without specifying the resourceName and resourceWeight parameters, the default CPU and memory settings in the following figure are used in node score calculation.

      cpu