Best practices for node pool deployment sets

Updated at:

Assign a deployment set to a node pool to distribute ECS instances across physical servers. Affinity configurations let applications become aware of the underlying node topology and spread workloads evenly across nodes, improving disaster recovery and high availability.

Prerequisites

A deployment set is created.

Background

In a single zone, you typically deploy services across multiple hosts for high availability. If a physical server fails, all replicas on it are affected. ECS deployment sets distribute instances across different physical servers in a region, ensuring mutual isolation and reducing service unavailability risk.

Limitations

Feature usage notes in clusters

  • Deployment sets support only ACK managed clusters and ACK dedicated clusters.

  • Specify a deployment set only when creating a node pool. Deployment sets cannot be enabled for existing node pools. Each node pool supports one deployment set.

  • You cannot manually add or remove nodes from a deployment set. Scale the node pool to adjust node count. See Create and manage node pools.

  • Node pools with deployment sets do not support spot instances.

Deployment set quotas and instance type limits

  • Deployment set quota limits:

    • Node pool deployment sets use the high availability policy by default. You can create up to 20 ECS instances per zone within a deployment set. The total ECS instance count per Alibaba Cloud region is 20 × number of zones . Ensure sufficient ECS instance quotas and inventory for your required instance types. See Deployment sets .

      The maximum instance count per deployment set cannot be increased. To raise the maximum number of deployment sets for your account, apply through the Quota Center. See Limits on deployment sets.

    • If creating an ECS instance in a deployment set or restarting a pay-as-you-go instance (in economical mode) fails, the cause may be insufficient inventory. Wait and retry.

  • Instance family restrictions: Most instance families of generation 6 or later support deployment sets that use the high availability, high availability group, and low latency strategies.

    Different deployment strategies support specific instance families.

    For a definitive list of supported instance families, see the response returned by the DescribeDeploymentSetSupportedInstanceTypeFamily API 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

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Nodes > Node Pools.

  3. On the Node Pools page, click Create Node Pool. In the Create Node Pool dialog box, configure the parameters, select a deployment set, and click Confirm.

    See Create and manage node pools for node pool parameters. After you select a deployment set, the maximum node count in the node pool is limited. The default limit is 20 × the number of zones. Ensure sufficient deployment set quota to avoid node scale-out failures.Create and manage node pools for node pool parameters.Deployment set

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

Schedule three pod replicas from a Deployment onto three different nodes.

  1. Create a node pool with three nodes and assign a deployment set.

    After creation, on the Node Pools page, click the node pool. On the Nodes tab, verify that three nodes were created.Deployment set example 1

    Log on to the ECS console. In the left navigation pane, choose Deployment & Elasticity > Deployment Set. On the Deployment Set page, verify that all three nodes belong to the deployment set.Deployment set example 2

  2. Configure your application with the following YAML.

    Set pod anti-affinity to schedule three application pods onto different nodes.

    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: 1

    Execution Result

    On the Deployments page, click the target Deployment. On the Pods tab, the three pods are scheduled onto different nodes.Deployment set example 3

Distribute pods from the same workload evenly across zones and nodes within a single node pool

  1. Create a node pool with four nodes, assign a deployment set, and select vSwitches in multiple zones.

    After creation, on the Node Pools page, click the node pool. On the Nodes tab, verify that four nodes exist across four zones. Per ESS’s even distribution policy, the ECS instances are spread across four zones and belong to the deployment set.Deployment set example 4

    Log on to the ECS console. In the left navigation pane, choose Deployment & Elasticity > Deployment Set. On the Deployment Set page, verify that all four nodes belong to the deployment set.Deployment set example 5

  2. Configure your application with the following YAML.

    Use pod topology spread constraints to distribute pods from the same application evenly across zones and nodes.

    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: 1

    Execution Result

    On the Deployments page, click the target Deployment. On the Pods tab, the pods are evenly distributed across zones and nodes.Deployment set example 6

References