Help Center/ Cloud Container Instance (CCI)/ Best Practices/ Workload Management/ Configuring Multi-AZ HA Deployment for CCI Pods
Updated on 2026-05-20 GMT+08:00

Configuring Multi-AZ HA Deployment for CCI Pods

Scenario

High availability is a core requirement in the production environment.

  • Risks of a single pod: There is only one pod (replicas = 1) deployed for a workload. Services will be interrupted if the node where this pod is running becomes faulty or is being upgraded, or the network fluctuates.
  • Risks of a single AZ: Multiple pods are deployed for a workload but they are in the same AZ. Services will still be interrupted if there is a power or network fault in the AZ.

To ensure high availability, you are advised to configure more than one pod (replicas > 1) in multiple AZs. You can use Kubernetes scheduling policies to schedule pods to different regions for intra-city DR.

Obtaining the AZ Information

Before configuring a scheduling policy, you need to confirm the AZ IDs supported by CCI in the current region. The IDs will be defined in the values parameter in the YAML file. You can view the AZs on the console or refer to the table below. (Note: As the business grows, there may be new regions and AZs for CCI. You can view the regions and AZs on the console.)

Region

AZ

ME-Riyadh (me-east-1)

me-east-1a

me-east-1b

me-east-1c

CN-Hong Kong (ap-southeast-1)

ap-southeast-1b

AP-Bangkok (ap-southeast-2)

ap-southeast-2a

AP-Singapore (ap-southeast-3)

ap-southeast-3a

ap-southeast-3b

ap-southeast-3e

AF-Johannesburg (af-south-1)

af-south-1a

LA-Sao Paulo1(sa-brazil-1)

sa-brazil-1a

LA-Mexico City2 (la-north-2)

la-north-2a

la-south-2b

(Recommended) Configuring Multi-AZ HA

You can configure podAntiAffinity to enable the scheduler to automatically distribute pods to different AZs.

Configuration example in CCI 2.0:

Key: topology.kubernetes.io/zone

apiVersion: cci/v2
kind: Deployment
metadata:
  name: app-ha-cci2
spec:
  replicas: 3
  template:
    metadata:
      labels:
        app: myapp
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 100
            podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: app
                  operator: In
                  values:
                  - myapp
              topologyKey: topology.kubernetes.io/zone

Configuring Scheduling in a Specified AZ

If you need to deploy pods in a specific AZ (for example, you want to use EVS disks in a specific AZ), you can use the nodeAffinity field.

The following is an example of distributing pods in an AZ in CCI 2.0:
apiVersion: cci/v2
kind: Pod
metadata:
  name: nginx-pinned-cci2
spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: topology.kubernetes.io/zone
            operator: In
            values:
            - cn-north-4a # Replace it with the actual AZ name.
  containers:
  - name: nginx
    image: nginx:latest