ALIYUN::CS::ClusterNodePool is used to create a node pool for a Container Service for Kubernetes (ACK) cluster.

Syntax

{
  "Type": "ALIYUN::CS::ClusterNodePool",
  "Properties": {
    "TeeConfig": Map,
    "ClusterId": String,
    "NodePoolInfo": Map,
    "KubernetesConfig": Map,
    "Count": Integer,
    "Management": Map,
    "AutoScaling": Map,
    "ScalingGroup": Map
  }
}

Properties

Property Type Required Editable Description Constraint
TeeConfig Map No No The confidential computing configurations of the cluster. For more information, see TeeConfig syntax and TeeConfig properties.
ClusterId String Yes No The ID of the cluster. You can call the DescribeClustersV1 operation to query the cluster ID.
NodePoolInfo Map No No The configurations of the node pool. For more information, see NodePoolInfo syntax and NodePoolInfo properties.
KubernetesConfig Map No No The configurations of the cluster. For more information, see KubernetesConfig syntax and KubernetesConfig properties.
Count Integer No No The number of nodes in the node pool. None.
Management Map No No The configurations of the managed node pool. For more information, see Management syntax and Management properties.
AutoScaling Map No No The auto scaling configurations of the cluster. For more information, see AutoScaling syntax and AutoScaling properties.
ScalingGroup Map Yes No The configurations of the scaling group that is used by the node pool.

You can call the DescribeClusterNodePools operation to query the configurations of the scaling group.

For more information, see ScalingGroup syntax and ScalingGroup properties.

TeeConfig syntax

"TeeConfig": {
  "TeeEnable": Boolean
}

TeeConfig properties

Property Type Required Editable Description Constraint
TeeEnable Boolean Yes No Specifies whether to enable confidential computing for the cluster. Default value: false. Valid values:
  • true: enables confidential computing for the cluster.
  • false: does not enable confidential computing for the cluster.

NodePoolInfo syntax

"NodePoolInfo": {
  "ResourceGroupId": String,
  "Name": String
}

NodePoolInfo properties

Property Type Required Editable Description Constraint
ResourceGroupId String No No The ID of the resource group to which the node pool belongs. None.
Name String Yes No The name of the node pool. None.

KubernetesConfig syntax

"KubernetesConfig": {
  "CpuPolicy": String,
  "Runtime": String,
  "CmsEnabled": Boolean,
  "UserData": String,
  "NodeNameMode": String,
  "RuntimeVersion": String,
  "Labels": List,
  "Unschedulable": Boolean,
  "Taints": List
}

KubernetesConfig properties

Property Type Required Editable Description Constraint
CpuPolicy String No No The CPU management policy of the node. If the Kubernetes version of the cluster is 1.12.6 or later, the default value of the CpuPolicy property is none and the following values are valid:
  • static: grants the pods that have specific resource characteristics on the node with enhanced CPU affinity and exclusivity.
  • none: uses the default CPU affinity.
Runtime String Yes No The name of the container runtime. None.
CmsEnabled Boolean No No Specifies whether to install CloudMonitor on Elastic Compute Service (ECS) nodes.

After you install CloudMonitor on ECS nodes, you can view the monitoring information about the nodes in the CloudMonitor console. We recommend that you set this property to true.

Default value: false. Valid values:
  • true: installs CloudMonitor on ECS nodes.
  • false: does not install CloudMonitor on ECS nodes.
UserData String No No The user data on the node. None.
NodeNameMode String No No The custom name of the node. A node name consists of a prefix, an IP address substring, and a suffix.
  • The prefix and suffix can contain one or more parts that are separated by periods (.). Each part can contain lowercase letters, digits, and hyphens (-). The node name must start and end with a lowercase letter or a digit.
  • The IP address substring consists of 5 to 12 digits that are truncated from the end of the node IP address.
RuntimeVersion String Yes No The version of the container runtime. None.
Labels List No No The labels that you want to add to the nodes in the cluster.

For more information, see Labels syntax and Labels properties.

Unschedulable Boolean No No Specifies whether to schedule the newly added node. Default value: false. Valid values:
  • true: schedules the newly added node. You can enable node schedulability on the Nodes page in the ACK console.
  • false: does not schedule the newly added node.
Taints List No No The configurations of the taints.

For more information, see Taints syntax and Taints properties.

Labels syntax

"Labels": [
  {
    "Value": String,
    "Key": String
  }
]

Labels properties

Property Type Required Editable Description Constraint
Value String Yes No The value of the label. None.
Key String Yes No The key of the label. None.

Taints syntax

"Taints": [
  {
    "Value": String,
    "Effect": String,
    "Key": String
  }
]

Taints properties

Property Type Required Editable Description Constraint
Value String Yes No The value of the taint. None.
Effect String No No The scheduling policy of the taint. Default value: NoSchedule. Valid values:
  • NoSchedule: Pods that do not tolerate the taint are not scheduled to the node that contains this taint. This policy affects only the scheduling process and takes effect only for newly added pods. This policy does not affect scheduled pods.
  • NoExecute: Pods that do not tolerate the taint are evicted after you add this taint to the node.
  • PreferNoSchedule: This is a preference or soft version of NoSchedule. This policy does not affect existing pods on the node.
Key String Yes No The name of the taint. None.

Management syntax

"Management": {
  "UpgradeConfig": Map,
  "AutoRepair": Boolean,
  "Enable": Boolean
}

Management properties

Property Type Required Editable Description Constraint
UpgradeConfig Map No No The automatic upgrade configurations of the cluster. This property takes effect only when you set the Enable property to true.

For more information, see UpgradeConfig syntax and UpgradeConfig properties.

AutoRepair Boolean No No Specifies whether to enable automatic repair. This property takes effect only when you set the Enable property to true.

Default value: false. Valid values:

  • true: enables automatic repair.
  • false: disables automatic repair.
Enable Boolean Yes No Specifies whether to enable the managed node pool. Default value: false. Valid values:
  • true: enables the managed node pool.
  • false: disables the managed node pool.

UpgradeConfig syntax

"UpgradeConfig": {
  "AutoUpgrade": Boolean,
  "SurgePercentage": Integer,
  "Surge": Integer,
  "MaxUnavailable": Integer
}

UpgradeConfig properties

Property Type Required Editable Description Constraint
AutoUpgrade Boolean No No Specifies whether to enable automatic upgrade. Default value: false. Valid values:
  • true: enables automatic upgrade.
  • false: does not enable automatic upgrade.
SurgePercentage Integer No No The proportion of additional nodes to total nodes in the node pool. You can specify the SurgePercentage or Surge property.
Surge Integer No No The number of additional nodes. You can specify the SurgePercentage or Surge property.
MaxUnavailable Integer No No The maximum number of nodes that are in the Unschedulable state. Valid values: 1 to 1000. Default value: 1.

AutoScaling syntax

"AutoScaling": {
  "EipBandwidth": Integer,
  "Type": String,
  "IsBondEip": Boolean,
  "MinInstances": Integer,
  "Enable": Boolean,
  "MaxInstances": Integer,
  "EipInternetChargeType": String
}

AutoScaling properties

Property Type Required Editable Description Constraint
EipBandwidth Integer No No The peak bandwidth of the elastic IP address (EIP). None.
Type String No No The type of auto scaling. Default value: cpu. The value of the Type property varies based on the type of the instance that can be used for auto scaling of the node pool. Valid values:
  • cpu: regular instance
  • gpu: GPU-accelerated instance
  • gpushare: shared GPU-accelerated instance
  • spot: preemptible instance
IsBondEip Boolean No No Specifies whether to associate an EIP with the node pool. Default value: false. Valid values:
  • true: associates an EIP with the node pool.
  • false: does not associate an EIP with the node pool.
MinInstances Integer No No The minimum number of instances that the scaling group can contain. None.
Enable Boolean Yes No Specifies whether to enable auto scaling for the node pool. Default value: false. Valid values:
  • true: enables auto scaling for the node pool.
  • false: does not enable auto scaling for the node pool. If you set the Enable property to false, other properties in the "AutoScaling properties" section cannot take effect.
MaxInstances Integer No No The maximum number of instances that the scaling group can contain. None.
EipInternetChargeType String No No The metering method for network usage of the EIP. Default value: PayByBandwidth. Valid values:
  • PayByBandwidth: pay-by-bandwidth
  • PayByTraffic: pay-by-data-transfer

ScalingGroup syntax

"ScalingGroup": {
  "SpotInstanceRemedy": Boolean,
  "Platform": String,
  "DataDisks": List,
  "SystemDiskSize": Integer,
  "CompensateWithOnDemand": Boolean,
  "InstanceChargeType": String,
  "OnDemandPercentageAboveBaseCapacity": Integer,
  "AutoRenew": Boolean,
  "OnDemandBaseCapacity": Integer,
  "SystemDiskPerformanceLevel": String,
  "ImageId": String,
  "SpotPriceLimit": List,
  "InstanceTypes": List,
  "Tags": List,
  "SpotStrategy": String,
  "LoginPassword": String,
  "MultiAzPolicy": String,
  "AutoRenewPeriod": Integer,
  "ScalingPolicy": String,
  "KeyPair": String,
  "VSwitchIds": List,
  "SecurityGroupId": String,
  "SpotInstancePools": Integer,
  "Period": Integer,
  "InternetChargeType": String,
  "SystemDiskCategory": String,
  "InternetMaxBandwidthOut": Integer,
  "RdsInstances": List,
  "PeriodUnit": String,
  "ZoneIds": List   
}

ScalingGroup properties

Property Type Required Editable Description Constraint
SpotInstanceRemedy Boolean No No Specifies whether to use preemptible instances. Default value: true. Valid values:
  • true: uses preemptible instances. When the system receives a message indicating that an existing preemptible instance is about to be reclaimed, the system attempts to create an instance in the scaling group to replace the existing preemptible instance.
  • false: does not use preemptible instances.
For more information, see Use preemptible instances.
Platform String No No The OS. Default value: AliyunLinux. Valid values:
  • CentOS
  • AliyunLinux
  • Windows
  • WindowsCore
DataDisks List No No The configurations of the data disks that you want to attach to the nodes in the node pool. For more information, see DataDisks syntax and DataDisks properties.
SystemDiskSize Integer Yes No The system disk size of the node. Unit: GiB. Valid values: 40 to 500.
CompensateWithOnDemand Boolean No No Specifies whether to automatically create pay-as-you-go instances to meet the required number of ECS instances when the system cannot create sufficient preemptible instances due to reasons such as the price or insufficient inventory. This property takes effect only when you set the MultiAzPolicy property to COST_OPTIMIZED. Default value: true. Valid values:
  • true: automatically creates pay-as-you-go instances.
  • false: does not automatically create pay-as-you-go instances.
InstanceChargeType String No No The billing method of the nodes in the node pool. Default value: PostPaid. Valid values:
  • PrePaid: subscription
  • PostPaid: pay-as-you-go
OnDemandPercentageAboveBaseCapacity Integer No No The proportion of pay-as-you-go instances to the extra instances that exceed the number specified by the OnDemandBaseCapacity property. Valid values: 0 to 100.
AutoRenew Boolean No No Specifies whether to enable auto-renewal for the nodes in the node pool. This property takes effect only when you set the InstanceChargeType property to PrePaid.

Default value: true. Valid values:

  • true: enables auto-renewal for the nodes in the node pool.
  • false: does not enable auto-renewal for the nodes in the node pool.
OnDemandBaseCapacity Integer No No The minimum number of pay-as-you-go instances that the scaling group must contain. Valid values: 0 to 1000. The system preferentially creates pay-as-you-go instances when the number of pay-as-you-go instances is less than the value of this property.
SystemDiskPerformanceLevel String No No The performance level (PL) of the enhanced SSD (ESSD) that is used as the system disk. Valid values:
  • PL1: An ESSD can deliver up to 50,000 random read/write IOPS.
  • PL2: An ESSD can deliver up to 100,000 random read/write IOPS.
  • PL3: An ESSD can deliver up to 1,000,000 random read/write IOPS.
For more information, see ESSDs.
ImageId String No No The ID of the custom image. By default, the image that is provided by ACK is used.
SpotPriceLimit List No No The maximum hourly price for the instance. The value of this property can contain up to three decimal places. This property takes effect only when you set the SpotStrategy property to SpotWithPriceLimit.

For more information, see SpotPriceLimit syntax and SpotPriceLimit properties.

InstanceTypes List Yes No The instance type of the preemptible instances. None.
Tags List No No The labels that you want to add only to ECS instances. A label key must be unique and cannot exceed 128 characters in length. Label keys and values cannot start with aliyun or acs:, and cannot contain https:// or http://.

For more information, see Tags syntax and Tags properties.

SpotStrategy String No No The bidding policy for the instance. Valid values:
  • NoSpot: The instance is not a preemptible instance.
  • SpotWithPriceLimit: The instance is a preemptible instance for which you specify the maximum hourly price.
  • SpotAsPriceGo: The instance is a preemptible instance for which the system automatically bids based on the current market price.
For more information, see Use preemptible instances.
LoginPassword String No No The password for SSH logon. You can specify the KeyPair or LoginPassword property.

The password must be 8 to 30 characters in length and contain the following character types: letters, digits, and special characters. Special characters include ( ) ` ~ ! @ # $ % ^ & * - _ + = | { } [ ] : ; ' < > , . ? /.

MultiAzPolicy String No No The scaling policy for the ECS instances in a multi-zone scaling group. Default value: PRIORITY. Valid values:
  • PRIORITY: scales ECS instances based on the priorities of the vSwitches that you specify. If the system cannot create ECS instances in the zone where the vSwitch that has the highest priority resides, the system uses the vSwitch that has the next highest priority to create the ECS instances.
  • COST_OPTIMIZED: creates ECS instances in ascending order of the unit prices of the vCPUs. If you specify multiple preemptible instance types in the scaling configuration, the system preferentially creates preemptible instances. You can configure the CompensateWithOnDemand property to specify whether to automatically create pay-as-you-go instances when the system cannot create preemptible instances due to reasons such as insufficient inventory.
    Note The value COST_OPTIMIZED takes effect only when you specify multiple instance types or when you specify at least one preemptible instance type.
  • BALANCE: evenly distributes ECS instances across zones that are specified in the scaling group. If ECS instances are not evenly distributed across zones due to reasons such as insufficient inventory, you can call the RebalanceInstances operation to evenly re-distribute ECS instances across zones.
AutoRenewPeriod Integer No No The auto-renewal period for the nodes in the node pool. This property takes effect and is required only if you set the InstanceChargeType property to PrePaid and the AutoRenew property to true.

If you set the PeriodUnit property to Month, the default value of the AutoRenewPeriod property is 1 and the following values are valid:

  • 1
  • 2
  • 3
  • 6
  • 12
ScalingPolicy String No No The scaling mode of the scaling group. Default value: release. Valid values:
  • release: the standard mode. To implement auto scaling, the system creates and releases ECS instances based on the resource requests and usage.
  • recycle: the swift mode. To implement auto scaling, the system creates, stops, and starts ECS instances. This mode accelerates scaling activities. When an instance is stopped, you are charged only for storage fees. For stopped ECS instances that are attached with local disks, you are charged for all billable items.
KeyPair String No No The name of the key pair that is used for password-free logon.

You can specify the KeyPair or LoginPassword property.

Note If you create a managed node pool, only the KeyPair property is supported.
VSwitchIds List Yes No The ID of the vSwitch. None.
SecurityGroupId String No No The ID of the security group. None.
SpotInstancePools Integer No No The number of available instance types. The system evenly creates preemptible instances of multiple instance types that are available at the lowest cost in the scaling group. Valid values: 1 to 10.
Period Integer No No The auto-renewal period for the nodes in the node pool. This property takes effect and is required only if you set the InstanceChargeType property to PrePaid and the AutoRenew property to true. If you set the PeriodUnit property to Month, the default value of the Period property is 1 and the following values are valid:
  • 1
  • 2
  • 3
  • 6
  • 12
InternetChargeType String No No The metering method for network usage. Default value: PayByBandwidth. Valid values:
  • PayByBandwidth: pay-by-bandwidth
  • PayByTraffic: pay-by-data-transfer
SystemDiskCategory String No No The system disk category of the node. Default value: cloud_efficiency. Valid values:
  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • cloud_essd: ESSD
InternetMaxBandwidthOut Integer No No The maximum outbound public bandwidth.

Unit: Mbit/s.

Valid values: 1 to 100.

RdsInstances List No No The IDs of the ApsaraDB RDS instances. None.
PeriodUnit String No No The unit of the subscription duration of nodes in the node pool. This property is required only if you set the InstanceChargeType property to PrePaid.

Valid values:

  • Month
  • Year
ZoneIds List No No The IDs of the zones. None.

DataDisks syntax

"DataDisks": [
  {
    "Category": String,
    "Encrypted": Boolean,
    "PerformanceLevel": String,
    "Size": Integer,
    "AutoSnapshotPolicyId": String
  }
]

DataDisks properties

Property Type Required Editable Description Constraint
Category String No No The category of the data disk. Default value: cloud_efficiency. Valid values:
  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • cloud_essd: ESSD
Encrypted Boolean No No Specifies whether to encrypt the data disk. Default value: false. Valid values:
  • true: encrypts the data disk.
  • false: does not encrypt the data disk.
PerformanceLevel String No No The PL of the ESSD that is used as the data disk. Valid values:
  • PL1: An ESSD can deliver up to 50,000 random read/write IOPS.
  • PL2: An ESSD can deliver up to 100,000 random read/write IOPS.
  • PL3: An ESSD can deliver up to 1,000,000 random read/write IOPS.
For more information, see ESSDs.
Size Integer No No The size of the data disk. Valid values: 40 to 32768.

Default value: 120.

Unit: GiB.

AutoSnapshotPolicyId String No No The ID of the automatic snapshot policy. The system performs automatic backup for a cloud disk based on the specified automatic snapshot policy. By default, this property is empty. This indicates that automatic backup is not performed.

SpotPriceLimit syntax

"SpotPriceLimit": [
  {
    "PriceLimit": Number,
    "InstanceType": String
  }
]

SpotPriceLimit properties

Property Type Required Editable Description Constraint
PriceLimit Number Yes No The maximum price for the preemptible instance. None.
InstanceType String Yes No The instance type of the preemptible instance. None.

Tags syntax

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags properties

Property Type Required Editable Description Constraint
Value String Yes No The value of the label. None.
Key String Yes No The key of the label. None.

Return values

Fn::GetAtt

NodePoolId: the ID of the cluster node pool.

Examples

  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "TeeConfig": {
          "Type": "Json",
          "Description": "The configurations of confidential computing.",
          "Default": "{\n  \"TeeEnable\": true\n}"
        },
        "ClusterId": {
          "Type": "String",
          "Description": "Cluster ID.",
          "Default": "c64ca201b0a4b49agfd****"
        },
        "NodePoolInfo": {
          "Type": "Json",
          "Description": "The configurations of the node pool.",
          "Default": "{\n  \"Name\": \"test\"\n}"
        },
        "KubernetesConfig": {
          "Type": "Json",
          "Description": "The configurations of the ACK cluster.",
          "Default": "{\n  \"CpuPolicy\": \"static\",\n  \"Runtime\": \"containerd\",\n  \"CmsEnabled\": true,\n  \"UserData\": \"echo 'hello'\",\n  \"NodeNameMode\": \"customized,aliyun.com,5,test\",\n  \"RuntimeVersion\": \"1.4.8\",\n  \"Unschedulable\": false\n}"
        },
        "Count": {
          "Type": "Number",
          "Description": "The number of nodes in the node pool.",
          "Default": 1
        },
        "Management": {
          "Type": "Json",
          "Description": "The configurations of the managed node pool.",
          "Default": "{\n  \"UpgradeConfig\": {\n    \"AutoUpgrade\": true,\n    \"Surge\": 1,\n    \"MaxUnavailable\": 1\n  },\n  \"AutoRepair\": true,\n  \"Enable\": true\n}"
        },
        "ScalingGroup": {
          "Type": "Json",
          "Description": "The configurations of the scaling group used by the node pool.",
          "Default": "{\n  \"SpotInstanceRemedy\": true,\n  \"Platform\": \"AliyunLinux\",\n  \"SystemDiskSize\": 120,\n  \"InstanceChargeType\": \"PostPaid\",\n  \"SystemDiskPerformanceLevel\": \"PL1\",\n  \"ImageId\": \"aliyun_2_1903_x64_20G_alibase_20210726.vhd\",\n  \"InstanceTypes\": [\n    \"ecs.ebmhfc6.20xlarge\"\n  ],\n  \"LoginPassword\": \"test****\",\n  \"MultiAzPolicy\": \"BALANCE\",\n  \"VSwitchIds\": [\n    \"vsw-*****\"\n  ],\n  \"SystemDiskCategory\": \"cloud_essd\",\n  \"InternetMaxBandwidthOut\": 0\n}"
        }
      },
      "Resources": {
        "ClusterNodePool": {
          "Type": "ALIYUN::CS::ClusterNodePool",
          "Properties": {
            "TeeConfig": {
              "Ref": "TeeConfig"
            },
            "ClusterId": {
              "Ref": "ClusterId"
            },
            "NodePoolInfo": {
              "Ref": "NodePoolInfo"
            },
            "KubernetesConfig": {
              "Ref": "KubernetesConfig"
            },
            "Count": {
              "Ref": "Count"
            },
            "Management": {
              "Ref": "Management"
            },
            "ScalingGroup": {
              "Ref": "ScalingGroup"
            }
          }
        }
      },
      "Outputs": {
        "NodePoolId": {
          "Description": "Cluster node pool ID.",
          "Value": {
            "Fn::GetAtt": [
              "ClusterNodePool",
              "NodePoolId"
            ]
          }
        }
      }
    }
  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      TeeConfig:
        Type: Json
        Description: The configurations of confidential computing.
        Default: |-
          {
            "TeeEnable": true
          }
      ClusterId:
        Type: String
        Description: Cluster ID.
        Default: c64ca201b0a4b49agfd****
      NodePoolInfo:
        Type: Json
        Description: The configurations of the node pool.
        Default: |-
          {
            "Name": "test"
          }
      KubernetesConfig:
        Type: Json
        Description: The configurations of the ACK cluster.
        Default: |-
          {
            "CpuPolicy": "static",
            "Runtime": "containerd",
            "CmsEnabled": true,
            "UserData": "echo 'hello'",
            "NodeNameMode": "customized,aliyun.com,5,test",
            "RuntimeVersion": "1.4.8",
            "Unschedulable": false
          }
      Count:
        Type: Number
        Description: The number of nodes in the node pool.
        Default: 1
      Management:
        Type: Json
        Description: The configurations of the managed node pool.
        Default: |-
          {
            "UpgradeConfig": {
              "AutoUpgrade": true,
              "Surge": 1,
              "MaxUnavailable": 1
            },
            "AutoRepair": true,
            "Enable": true
          }
      ScalingGroup:
        Type: Json
        Description: The configurations of the scaling group used by the node pool.
        Default: |-
          {
            "SpotInstanceRemedy": true,
            "Platform": "AliyunLinux",
            "SystemDiskSize": 120,
            "InstanceChargeType": "PostPaid",
            "SystemDiskPerformanceLevel": "PL1",
            "ImageId": "aliyun_2_1903_x64_20G_alibase_20210726.vhd",
            "InstanceTypes": [
              "ecs.ebmhfc6.20xlarge"
            ],
            "LoginPassword": "test****",
            "MultiAzPolicy": "BALANCE",
            "VSwitchIds": [
              "vsw-*****"
            ],
            "SystemDiskCategory": "cloud_essd",
            "InternetMaxBandwidthOut": 0
          }
    Resources:
      ClusterNodePool:
        Type: ALIYUN::CS::ClusterNodePool
        Properties:
          TeeConfig:
            Ref: TeeConfig
          ClusterId:
            Ref: ClusterId
          NodePoolInfo:
            Ref: NodePoolInfo
          KubernetesConfig:
            Ref: KubernetesConfig
          Count:
            Ref: Count
          Management:
            Ref: Management
          ScalingGroup:
            Ref: ScalingGroup
    Outputs:
      NodePoolId:
        Description: Cluster node pool ID.
        Value:
          Fn::GetAtt:
            - ClusterNodePool
            - NodePoolId