ALIYUN::CS::ClusterNodePool is used to create a node pool for a 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 configurations of confidential computing for 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 API 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 configurations of auto scaling. 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 API operation to query the configurations of the scaling group that is used by the node pool.

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: disables 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. Default value: none. Valid values if the Kubernetes version of the cluster is 1.12.6 or later: static and none.
  • static: This policy allows pods that have specific resource characteristics on the node to be granted with enhanced CPU affinity and exclusivity.
  • none: This policy specifies that the default CPU affinity is used.
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 monitoring information about the nodes in the CloudMonitor console. We recommend that you set CmsEnabled 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-defined data. 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 node name must start and end with a lowercase letter or a digit.
  • The prefix and suffix can contain one or more parts that are separated by periods (.). These parts can contain lowercase letters, digits, and hyphens (-).
  • The IP address substring consists of 5 to 12 digits that are truncated from the end of the node IP address.
For example, if the node IP address is 192.168.0.55, the prefix is aliyun.com, the length of the IP address substring is 5, and the suffix is test, the node name is aliyun.com00055test.
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 node that is most recently added. Default value: false. Valid values:
  • true: schedules the node that is most recently added. You can go to the Nodes page and set the nodes to schedulable.
  • false: does not schedule the node that is most recently added.
Taints List No No The taints that you want to add to the nodes.

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 Yes No The scheduling policy. Default value: NoSchedule. Valid values:
  • NoSchedule: Pods that do not tolerate this taint are not scheduled to nodes that have this taint. This policy affects only the scheduling process and takes effect only on pods to be scheduled. Scheduled pods are not affected by this policy.
  • NoExecute: Pods that do not tolerate this taint are removed after you add this taint to the node.
  • PreferNoSchedule: a "preference" or "soft" version of NoSchedule. Scheduled pods are not affected by this policy.
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 configurations of automatic upgrade. This property takes effect only if Enable is set 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 if Enable is set to true.

Default value: false. Valid values:

  • true: enables automatic repair.
  • false: does not enable 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: does not enable 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. You cannot specify SurgePercentage and Surge at the same time.
Surge Integer No No The number of additional nodes. You cannot specify SurgePercentage and Surge at the same time.
MaxUnavailable Integer No No The maximum number of nodes that can be 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 valid values of Type vary based on types of instances that are automatically scaled. 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 must be contained in the scaling group. None
Enable Boolean Yes No Specifies whether to enable auto scaling. Default value: false. Valid values:
  • true: enables auto scaling.
  • false: does not enable auto scaling. If Enable is set to false, other AutoScaling properties do not take effect.
MaxInstances Integer No No The maximum number of instances that can be contained in the scaling group. None
EipInternetChargeType String No No The billing method for network usage of the EIP. Default value: PayByBandwidth. Valid values:
  • PayByBandwidth
  • PayByTraffic

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
}

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. If this property is set to true, Auto Scaling attempts to create an instance to replace a preemptible instance when Auto Scaling receives a system message, which indicates that the preemptible instance is to be reclaimed.
  • false: does not use preemptible instances.
For more information, see Use preemptible instances.
Platform String No No The operating system. Default value: AliyunLinux. Valid values:
  • CentOS
  • AliyunLinux
  • Windows
  • WindowsCore
DataDisks List No No The configurations of data disks. 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 requirement on the number of ECS instances if the system cannot create preemptible instances due to reasons such as the price or insufficient inventory. This property takes effect only if MultiAzPolicy is set to COST_OPTIMIZED. Default value: true. Valid values:
  • true: automatically creates pay-as-you-go instances to meet the requirement on the number of ECS instances if the system cannot create preemptible instances.
  • false: does not automatically create pay-as-you-go instances to meet the requirement on the number of ECS instances if the system cannot create preemptible instances.
InstanceChargeType String No No The billing method for nodes in the node pool. Default value: PostPaid. Valid values:
  • PrePaid
  • PostPaid
OnDemandPercentageAboveBaseCapacity Integer No No The percentage of pay-as-you-go instances among the extra instances that exceed the number specified by OnDemandBaseCapacity. Valid values: 0 to 100.
AutoRenew Boolean No No Specifies whether to enable auto-renewal for nodes in the node pool. This property takes effect only if instance_charge_type is set to PrePaid.

Default value: true. Valid values:

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

For more information, see SpotPriceLimit syntax and SpotPriceLimit properties.

InstanceTypes List Yes No The instance type of preemptible instances. None
Tags List No No The tags of the ECS instance. A tag key must be unique and cannot exceed 128 characters in length. Tag keys and values cannot start with aliyun or acs:. Tag keys and values cannot contain https:// or http://.

For more information, see Tags syntax and Tags properties.

SpotStrategy String No No The bidding policy of the preemptible instance. Valid values:
  • NoSpot: non-preemptible instance.
  • SpotWithPriceLimit: You must specify the maximum price that you want to pay for the preemptible instance per hour.
  • SpotAsPriceGo: The system places bids based on the spot price.
For more information, see Use preemptible instances.
LoginPassword String No No The password for SSH logon. You cannot specify KeyPair and LoginPassword at the same time.

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 ECS instance scaling policy for 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 instance.
  • COST_OPTIMIZED: creates ECS instances based on the unit prices of the vCPUs in ascending order. If you specify multiple preemptible instance types in the scaling configuration, preemptible instances are preferentially created. You can configure the CompensateWithOnDemand property to specify whether to automatically create pay-as-you-go instances if the system cannot create preemptible instances due to reasons such as insufficient inventory.
    Note COST_OPTIMIZED takes effect only if you specify multiple instance types or if 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 unevenly distributed across zones due to reasons such as insufficient inventory, you can call the RebalanceInstances API operation to re-distribute ECS instances across zones.
AutoRenewPeriod Integer No No The auto-renewal period for nodes in the node pool. This property takes effect and is required only if InstanceChargeType is set to PrePaid and AutoRenew is set to true.

Default value: 1. Valid values if PeriodUnit is set to Month:

  • 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. ECS instances are created and are released based on resource usage.
  • recycle: the swift mode. ECS instances are created, stopped, or started during scaling activities. This reduces the time required for the next scaling activity. When an instance is stopped, you are charged only for the storage service. If on-premises disks are attached to your ECS instances, you are not charged for the storage service.
KeyPair String No No The name of the key pair that is used to log on to the nodes.

You cannot specify KeyPair and LoginPassword at the same time.

Note If you create a managed node pool, only KeyPair 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 instance types that are available. The system 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 nodes in the node pool. This property takes effect and is required only if InstanceChargeType is set to PrePaid and AutoRenew is set to true. Default value: 1. Valid values if PeriodUnit is set to Month:
  • 1
  • 2
  • 3
  • 6
  • 12
InternetChargeType String No No The billing method for network usage of the EIP. Default value: PayByBandwidth. Valid values:
  • PayByBandwidth
  • PayByTraffic
SystemDiskCategory String No No The type of the system disk. Default value: cloud_efficiency. Valid values:
  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • cloud_essd: ESSD
InternetMaxBandwidthOut Integer No No The maximum outbound bandwidth to the Internet.

Unit: Mbit/s.

Valid values: 1 to 100.

RdsInstances List No No The IDs of 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 InstanceChargeType is set to PrePaid.

Valid values:

  • Month
  • Year

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 type 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 Specifies the performance level of the ESSD. Valid values:
  • PL1: A single ESSD can deliver up to 50,000 random read/write IOPS.
  • PL2: A single ESSD can deliver up to 100,000 random read/write IOPS.
  • PL3: A single 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 an automatic snapshot policy. Automatic backup is performed for a disk based on the specified automatic snapshot policy. By default, this property is left empty, which specifies 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 price limit 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 tag. None
Key String Yes No The key of the tag. None

Return values

Fn::GetAtt

NodePoolId: the ID of the cluster node pool.

Examples

{
  "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\": \"Admin@123\",\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"
        ]
      }
    }
  }
}