A deployment set is a policy that controls how ECS instances are distributed. It spreads ECS instances across different physical servers to improve application high availability and enhance underlying disaster recovery capabilities. By assigning a deployment set to a node pool, you ensure that the ECS instances created by the node pool do not reside on the same physical server. Combined with affinity configurations, your application becomes aware of the underlying node topology and distributes its workloads evenly across nodes, improving both disaster recovery and high availability.
Prerequisites
You have created a deployment set. For more information, see Create a deployment set.
Background information
In a single zone, you typically deploy services across multiple hosts to ensure high availability. However, if one physical server fails, all replicas of your application on that server are affected. To address this issue, ECS provides deployment sets. All ECS instances within a deployment set are strictly distributed across different physical servers in the specified region. This satisfies application architectures that require mutual isolation between services and significantly reduces the risk of service unavailability. For more information about deployment sets, see Deployment sets.
Limits
Feature usage notes in clusters
-
Deployment sets support only ACK managed clusters and ACK dedicated clusters.
-
You can specify a deployment set only when creating a new node pool. You cannot enable it for an existing node pool. Each node pool supports binding to only one deployment set.
-
You cannot manually add or remove nodes from a deployment set. Adjust the number of nodes in the deployment set by scaling the node pool. For more information, see Create and manage node pools.
-
After enabling deployment sets, you cannot create spot instances.
Deployment set quotas and instance type limits
-
Deployment set quota limits:
-
By default, node pool deployment sets use the high availability policy. Under this policy, you can create up to 20 ECS instances per zone within a deployment set. The total number of ECS instances you can create in an Alibaba Cloud region is
20 × number of zones. Ensure sufficient ECS instance quotas and adequate inventory for your required instance types in the deployment set. For more information, see Deployment sets.The maximum number of instances allowed in a single deployment set cannot be increased. However, to raise the maximum number of deployment sets allowed for your account, apply through the Quota Center. For more information about deployment set limits and quotas, see Limits on deployment sets.
-
If creating an ECS instance in a deployment set fails, or if restarting a pay-as-you-go ECS instance (in economical mode) fails, the cause may be insufficient inventory in the region. Wait a while and retry creating or restarting the instance.
-
-
Instance family restrictions: Most instance families of generation 6 and later support deployment sets with the High Availability strategy, High Availability Group strategy, and Low Latency strategy.
Different deployment strategies support only specific instance families:
For the definitive list of supported instance families, refer to the output of the DescribeDeploymentSetSupportedInstanceTypeFamily operation.
Deployment strategy
Supported instance families
High Availability strategy and High Availability Group strategy
-
g9a, g9ae, g9i, g8a, g8i, g8ine, g8ise, g8y, g7, g7a, g7h, g7ne, g7nex, g7se, g7t, g6, g6a, g6e, g6h, g5, g5ne
-
c9a, c9ae, c9i, c8a, c8i, c8ine, c8y, c7, c7a, c7nex, c7se, c7t, c6, c6a, c6e, c5
-
r9a, r9ae, r9i, r8a, r8i, r8y, r7, r7a, r7se, r7t, r6, r6a, r6e, r5
-
hfc9i, hfg9i, hfr9i, hfc8i, hfg8i, hfr8i, hfc7, hfg7, hfr7, hfc6, hfg6, hfr6, hfc5, hfg5
-
ebmc9i, ebmg9a, ebmg9i, ebmr9i, ebmc8a, ebmc8i, ebmc8y, ebmg8a, ebmg8i, ebmg8y, ebmr8a, ebmr8y, ebmc7, ebmc7a, ebmg7, ebmg7a, ebmg7se, ebmhfc7, ebmhfg7, ebmhfr7, ebmr7, ebmr7a, ebmg5
-
i5, i5g, i5ge, ic5, i4, i4g, i4r, i3, i3g, i2, i2g, i2gne, i2ne
-
gn6i
-
d3c, d3s, d2c, d2s, d1ne
-
re6, re6p, s6, t6, e4, mn4, n4, re4, xn4, sn2ne, u2a, u2i, se1, se1ne, sn1ne, u1, e
Low Latency strategy
-
g9a, g9ae, g9i, g8a, g8ae, g8i, g8ise, g8y, g7, g5ne
-
c9a, c9ae, c9i, c8a, c8ae, c8i, c8ine, c8y, c7, c7nex
-
r9a, r9ae, r9i, r8a, r8ae, r8i, r8y, r7
-
hfc9i, hfg9i, hfr9i, hfc8i, hfg8i, hfr8i
-
ebmc9i, ebmg9a, ebmg9i, ebmr9i, ebmc8a, ebmc8i, ebmc8y, ebmg8a, ebmg8i, ebmg8y, ebmgn8v, ebmr8a, ebmr8y, ebmc7, ebmc7a, ebmg7, ebmg7a, ebmg7se, ebmgn7ex, ebmhfc7, ebmhfg7, ebmhfr7, ebmr7, ebmr7a
-
i5, i5g, i5ge, i4
-
gn8v
-
hpc8ae, hpc8i, hpc7ip, hpc6id, u2a, u2i
-
Assign a deployment set to a node pool in the console
Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, click .
-
On the Node Pools page, click Create Node Pool. In the Create Node Pool dialog box, configure the parameters, select a deployment set, and then click Confirm.
For details about node pool configuration items, see Create and manage node pools.

Use cases
Schedule pods from the same workload in a single node pool so that only one pod runs per node using pod anti-affinity
This example shows how to schedule three pod replicas from a Deployment onto three different nodes. Follow these steps.
-
Create a node pool with three nodes and assign a deployment set ID to the node pool. For more information, see Assign a deployment set to a node pool in the console.
After creating the node pool, go to the Node Pools page, click the target node pool, and then on the Nodes tab, verify that three nodes were created successfully.

Log on to the ECS console. In the navigation pane on the left, choose . On the Deployment Set page, confirm that all three nodes in the node pool belong to the selected deployment set.

-
Use the following YAML to configure your application.
Configure pod anti-affinity to schedule the three application pods onto different nodes in the node pool.
apiVersion: apps/v1 kind: Deployment metadata: name: nginx labels: app: nginx spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: name: nginx labels: app: nginx spec: affinity: podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: # Set the scheduling policy. - labelSelector: matchExpressions: - key: app operator: In values: - nginx topologyKey: kubernetes.io/hostname nodeSelector: alibabacloud.com/nodepool-id: <nodepool-id> # Specify the node pool ID. containers: - name: nginx image: anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/nginx:1.14.1-8.6 resources: limits: cpu: 1 requests: cpu: 1Execution Result
On the Deployments page, click the target Deployment. On the Pods tab, you can see that the three pods are scheduled onto different nodes in the node pool.

Distribute pods from the same workload evenly across zones and nodes within a single node pool
-
Create a node pool with four nodes, assign a deployment set ID to the node pool, and select vSwitches in multiple zones. For more information, see Assign a deployment set to a node pool in the console.
After creation, go to the Node Pools page, click the target node pool, and then on the Nodes tab, verify that four nodes exist across four zones. Based on ESS’s even distribution policy, the created ECS instances are spread across four different zones and all belong to the deployment set.

Log on to the ECS console. In the navigation pane on the left, choose . On the Deployment Set page, confirm that all four nodes in the node pool belong to the selected deployment set.

-
Use the following YAML to configure your application.
Use pod topology spread constraints to distribute pods from the same application evenly across zones and nodes. For more information, see Pod topology spread constraints.
apiVersion: apps/v1 kind: Deployment metadata: name: nginx labels: app: nginx spec: replicas: 4 selector: matchLabels: app: nginx template: metadata: name: nginx labels: app: nginx spec: topologySpreadConstraints: - maxSkew: 1 topologyKey: kubernetes.io/hostname whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app: nginx - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app: nginx nodeSelector: alibabacloud.com/nodepool-id: <nodepool-id> # Specify the node pool ID. containers: - name: nginx image: anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/nginx:1.14.1-8.6 resources: limits: cpu: 1 requests: cpu: 1Execution Result
On the Deployments page, click the target Deployment. On the Pods tab, you can see that pods from the same application are evenly distributed across zones and nodes.

References
-
You can also assign a deployment set to a node pool using Terraform.
-
For recommended configurations for highly available cluster architectures, see Recommended configurations for highly available cluster architectures.