tencent cloud

All product documents
Tencent Kubernetes Engine
Setting the Scheduling Rule for a Workload
Last updated: 2024-12-19 22:09:58
Setting the Scheduling Rule for a Workload
Last updated: 2024-12-19 22:09:58

Overview

You can specify the scheduling of the Pods under a workload in the cluster by setting the scheduling policy in the advanced settings of the workload. The following are the typical use cases:
Run the Pods on a specific node.
Run the Pods on nodes in a specific scope (which can be an availability zone, a model and so on).

How to Configure Scheduling policies

Prerequisites

Kubernetes 1.7 or later, and scheduling policies are configured. Scheduling policies can be found under the Advanced Settings of a workload.
To ensure that your Pods can be scheduled successfully, the node should have resources available for container scheduling after the scheduling policy is configured.
You need node labels if you use custom scheduling features. For details, refer to Setting Node Label.

Configuring a scheduling policy

If your cluster is created using Kubernetes 1.7 or later, you can set a scheduling policy when creating a workload. Select one of the following scheduling types:
Schedule to a specific node: schedule Pods to a specific node with matching node labels.

Custom scheduling: customize how Pods are scheduled by matching Pod labels.

Custom scheduling policies have the following modes:
Conditions that must be met: if a node meets the affinity conditions, the Pods are scheduled to the corresponding node. If not, the scheduling fails.
Conditions that should be met if possible: if a node meets the affinity conditions, the Pods are scheduled to the corresponding node. If not, the pods are scheduled to a random node.
Multiple custom scheduling policies can be added. The following is a list of operators:
In: the value of the label is in the list.
NotIn: the value of the label is not in the list.
Exists: the key of the label exists.
DoesNotExits: the key of the label does not exist.
Gt: the value of the label is greater than the listed value (string match).
Lt: the value of the label is less than the listed value (string match).

How It Works

Kubernetes uses YAML files to distribute scheduling policies and the affinity and anti-affinity mechanism ensures that Pods are scheduled according to rules. For more information on this mechanism, refer to Kubernetes official documentation.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon