When you create or deploy an application in a Container Service for Kubernetes (ACK) cluster, you can modify the scheduling rules of pods as needed and deploy pods in as many nodes and zones as possible to enhance application availability. This topic describes how to configure scheduling rules.
Configure scheduling rules when you create an application
Log on to the EDAS console. In the left-side navigation pane, choose . The Applications page appears. In the top navigation bar, select a region. In the upper part of the page, select a namespace. In the upper-left corner, click Create Application.
- In the Basic Information step, set the Cluster Type and Application Runtime Environment parameters and then click Next. The following table describes the parameters.
Parameter Description Cluster Type The type of the cluster in which you want to deploy the application. Select Kubernetes Clusters. Application Runtime Environment The application runtime environment. Select an application runtime environment based on the type of the application. - Java:
- Custom: Select this option if you want to use a custom image to deploy the application in an ACK cluster.
- Java: Select this option if you want to use a universal JAR package to deploy the application as a Dubbo or a Spring Boot application. You can set the Java Environment parameter after you select this option.
- Tomcat: Select this option if you want to use a universal WAR package to deploy the application as a Dubbo or a Spring application. You can set the Java Environment and Container Version parameters after you select this option.
- EDAS-Container (HSF): Select this option if you want to use a WAR or FatJar package to deploy the application as a High-speed Service Framework (HSF) application. You can set the Java Environment, Pandora Version, and Ali-Tomcat Version parameters after you select this option.
- PHP: Select this option if you want to deploy the application as a PHP application that runs on Apache HTTP Server.
- Node.js, C++, Go, and Other Languages: Select this option if you want to deploy a microservices application by using a custom image. The application can be developed in any programming language.
- Java:
In the Configurations step, configure the environment information, basic information, and deployment method for the application, set the related resource parameters, and then click Next.
- In the Advanced Settings step, click Scheduling Rules and configure the scheduling mode and rules as needed.
- Select the Built-in Configuration mode.
Parameter Description Zone Scheduling - Default Scheduling: By default, the pods are scheduled based on the status of cluster resources. The system may deploy all pods in the same zone. Therefore, this scheduling rule does not ensure high availability.
- Deploy in As Many Zones As Possible: Anti-affinity rules are used to deploy the pods to as many zones as possible to ensure high availability.
Node Scheduling - Default Scheduling: By default, the pods are scheduled based on the loads of cluster nodes.
- Deploy to as Many Nodes as Possible: The pods are deployed to as many nodes as possible to ensure high availability.
- Select the Custom Configuration mode.
If the built-in scheduling rules based on zones or nodes cannot meet your requirements in complicated scenarios, you can also use the custom configuration feature provided by Enterprise Distributed Application Service (EDAS) to customize your own rules.
Table 1. Create a scheduling rule on the node affinity Parameter Description Selector The conditions used to filter nodes. You can set the Node Tag Key, Operator, and Node Tag Value parameters to specify the nodes to which the pods are deployed.
Weight The weight of the rule. Valid values: an integer from 0 to 100. Default value: 1. Table 2. Create a scheduling rule on the application affinity Parameter Description Kubernetes Namespace The namespace of the ACK cluster that hosts the application. Topology Key The key of node labels that are used to determine whether different nodes are in the same topology domain, such as a node, zone, or region. Selector The conditions used to filter pods. You can set the Application Tag Key, Operator, and Application Tag Value parameters to determine the pods to run in the corresponding topology domain. Weight The weight of the rule. Valid values: an integer from 0 to 100. Default value: 1. Table 3. Create a scheduling rule on the application anti-affinity Parameter Description Kubernetes Namespace The namespace of the ACK cluster that hosts the application. Topology Key The key of node labels that are used to determine whether different nodes are in the same topology domain, such as a node, zone, or region. Selector The conditions used to filter pods. You can set the Application Tag Key, Operator, and Application Tag Value parameters to determine the pods to run in the corresponding topology domain. Weight The weight of the rule. Valid values: an integer from 0 to 100. Default value: 1. Table 4. Create a scheduling rule on toleration Parameter Description Tag Key The key used to match taints. Operator The operator used to match taints. Tag Value The value used to match taints. The toleration matches taints based on the Tag Key, Tag Value, Operator, and Effect parameters that you set. Effect The effect that applies after a taint on a node is tolerated. Tolerance (Seconds) You can set this parameter only if the Effect parameter is set to NoExecute.
The amount of time during which a pod can run on the node after the taint is tolerated. If this parameter is not set, the pod can keep running on the node. - Select the Built-in Configuration mode.
Click Create Application.
In the Creation Completed step, confirm the settings in the Basic Information, Configurations, and Advanced Settings sections, and then click Create Application.
In the upper part of the Application Overview page, click View Details. On the Change List page, you can view the change process. Wait several minutes until the application is deployed. After the application change process is complete, view the status of the instance in the Basic Information section of the Application Overview page. If the status shows that a pod is running, the application is deployed.
Configure scheduling rules when you update an application
You can configure scheduling rules when you create an application or deploy an application.
Log on to the EDAS console.
In the left-side navigation pane, click . In the top navigation bar, select a region. In the upper part of the page, select a namespace. Select Container Service or Serverless Kubernetes Cluster from the Cluster Type drop-down list. Then, find the application that you want to deploy and click the application name.
On the Overview or Basic information page, choose in the upper-right corner.
On the Select Deployment Mode page, select a deployment mode and click Start Deployment in the upper-right corner of the specified deployment mode section.
- Set the environment and deployment package information, click Scheduling Rules, complete the configuration as needed, and then click OK.
- Select the Built-in Configuration mode.
Parameter Description Zone Scheduling - Default Scheduling: By default, the pods are scheduled based on the status of cluster resources. The system may deploy all pods in the same zone. Therefore, this scheduling rule does not ensure high availability.
- Deploy in As Many Zones As Possible: Anti-affinity rules are used to deploy the pods to as many zones as possible to ensure high availability.
Node Scheduling - Default Scheduling: By default, the pods are scheduled based on the loads of cluster nodes.
- Deploy to as Many Nodes as Possible: The pods are deployed to as many nodes as possible to ensure high availability.
- Select the Custom Configuration mode.
If the built-in scheduling rules based on zones or nodes cannot meet your requirements in complicated scenarios, you can also use the custom configuration feature provided by Enterprise Distributed Application Service (EDAS) to customize your own rules.
Table 1. Create a scheduling rule on the node affinity Parameter Description Selector The conditions used to filter nodes. You can set the Node Tag Key, Operator, and Node Tag Value parameters to specify the nodes to which the pods are deployed.
Weight The weight of the rule. Valid values: an integer from 0 to 100. Default value: 1. Table 2. Create a scheduling rule on the application affinity Parameter Description Kubernetes Namespace The namespace of the ACK cluster that hosts the application. Topology Key The key of node labels that are used to determine whether different nodes are in the same topology domain, such as a node, zone, or region. Selector The conditions used to filter pods. You can set the Application Tag Key, Operator, and Application Tag Value parameters to determine the pods to run in the corresponding topology domain. Weight The weight of the rule. Valid values: an integer from 0 to 100. Default value: 1. Table 3. Create a scheduling rule on the application anti-affinity Parameter Description Kubernetes Namespace The namespace of the ACK cluster that hosts the application. Topology Key The key of node labels that are used to determine whether different nodes are in the same topology domain, such as a node, zone, or region. Selector The conditions used to filter pods. You can set the Application Tag Key, Operator, and Application Tag Value parameters to determine the pods to run in the corresponding topology domain. Weight The weight of the rule. Valid values: an integer from 0 to 100. Default value: 1. Table 4. Create a scheduling rule on toleration Parameter Description Tag Key The key used to match taints. Operator The operator used to match taints. Tag Value The value used to match taints. The toleration matches taints based on the Tag Key, Tag Value, Operator, and Effect parameters that you set. Effect The effect that applies after a taint on a node is tolerated. Tolerance (Seconds) You can set this parameter only if the Effect parameter is set to NoExecute.
The amount of time during which a pod can run on the node after the taint is tolerated. If this parameter is not set, the pod can keep running on the node.Important The application is restarted after you click OK. We recommend that you perform this operation during off-peak hours. - Select the Built-in Configuration mode.