Updated on 2024-12-18 GMT+08:00

Setting AZ Affinity

Scenario

An availability zone (AZ) is a physical region in a data center where resources use independent power supplies and networks. Nodes in the same AZ can quickly communicate with each other through a high-speed network, while nodes in different AZs need to communicate with each other across physical distances, which may cause latency and risks.

Scheduling pods to different AZs improves the availability and fault tolerance of applications.

Procedure

For a CCE Autopilot cluster, you can set workload annotations to implement AZ affinity and schedule pods to specified AZs.

  1. Log in to the CCE console.
  2. Click the cluster name to go to the cluster console, choose Workloads in the navigation pane on the left, and click the Create Workload in the upper right corner.
  3. In the Advanced Settings area, select Labels and Annotations and set the following annotation:

    • Key: node.cce.io/node-az-list
    • Value: AZ name. Use commas (,) to separate multiple AZs.

      For details about AZ names in different regions, see Regions and Endpoints.

    Figure 1 Setting AZ affinity

  4. Configure other workload parameters and click Create Workload.