Updated on 2024-06-17 GMT+08:00

Configuring Scheduling and Differentiation

Scheduling Policies

The current page supports two policies: cluster weighted scheduling and automatic balancing.

Configuring a Scheduling Policy on the Console

  1. Log in to the UCS console.
  2. When creating a workload, click Next: Scheduling and Differentiation.
  3. Add a scheduling policy.

    Table 1 Scheduling policies

    Policy

    Description

    Cluster weighted scheduling

    You need to select a cluster and configure the scheduling weight. Pods will be scheduled based on the cluster weight ratio.

    Auto balancing

    The system automatically selects a cluster to distribute pods based on the remaining resources. No additional configuration is required.

Tolerance Policies

A tolerance policy allows the scheduler to schedule pods to clusters with corresponding taints. This policy must be used together with cluster taints.

Using the Default Tolerance Policy

When you create a workload, UCS configures a default tolerance policy for your workload. The default tolerance policy adds taints listed in Table 2 to a faulty cluster. If the tolerance duration is exceeded, all pods in the cluster will be automatically evicted.

After all pods in the faulty cluster are evicted, UCS does not migrate the pods back to the cluster based on the original scheduling policy after the cluster recovers. If you want to continue with the original scheduling policy configuration, you can reschedule the workload.

Table 2 Taints for faulty clusters

Taint Key

Tolerance Policy

cluster.karmada.io/not-ready

When the cluster is not ready, this taint is automatically added. If the tolerance duration is exceeded, all pods in the cluster will be automatically evicted.

cluster.karmada.io/unreachable

When the cluster is unavailable, this taint is automatically added. If the tolerance duration is exceeded, all pods in the cluster will be automatically evicted.

Configuring a Tolerance Policy on the Console

  1. Log in to the UCS console.
  2. When creating a workload, click Next: Scheduling and Differentiation.
  3. Add a tolerance policy.

    Parameter

    Description

    Taint Key

    Taint key of the cluster.

    Operator

    • Equal: matches the nodes with the specified taint key (mandatory) and value. If the taint value is left blank, all taints with the key the same as the specified taint key will be matched.
    • Exists: matches the nodes with the specified taint key. In this case, the taint value cannot be specified. If the taint key is left blank, all taints will be tolerated.

    Taint Value

    • If the value of Operator is Exists, the value attribute can be omitted.
    • If the value of Operator is Equal, the relationship between the key and value is Equal.
    • If Operator is not specified, the default value is Equal.

    Taint Policy

    • All: All taint policies are matched.
    • NoSchedule: Only the NoSchedule taint is matched.
    • NoExecute: Only the NoExecute taint is matched.

    Toleration Time Window

    tolerationSeconds, which is configurable only when Taint Policy is set to NoExecute.

    Within the tolerance time window, pods still run on the node with taints. After the time expires, the pods will be evicted. If the tolerance time window is not configured, the pods will never be evicted.