ALIYUN::CS::ClusterNodePool类型用于为集群创建节点池。
语法
{
"Type": "ALIYUN::CS::ClusterNodePool",
"Properties": {
"TeeConfig": Map,
"ClusterId": String,
"NodePoolInfo": Map,
"KubernetesConfig": Map,
"Count": Integer,
"Management": Map,
"AutoScaling": Map,
"ScalingGroup": Map
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
ClusterId | String | 是 | 否 | 集群ID。 | 您可以通过调用DescribeClustersV1查询集群ID。 |
ScalingGroup | Map | 是 | 是 | 节点池扩容组配置。 | 您可以通过调用DescribeClusterNodePools查询节点池扩容组配置。 更多信息,请参见ScalingGroup语法和ScalingGroup属性。 |
AutoScaling | Map | 否 | 否 | 自动伸缩配置。 | 更多信息,请参见AutoScaling语法和AutoScaling属性。 |
Count | Integer | 否 | 否 | 节点池节点数量。 | 无 |
KubernetesConfig | Map | 否 | 是 | 集群相关配置。 | 更多信息,请参见KubernetesConfig语法和KubernetesConfig属性。 |
Management | Map | 否 | 否 | 托管节点池配置。 | 更多信息,请参见Management语法和Management属性。 |
NodePoolInfo | Map | 否 | 否 | 节点池配置。 | 更多信息,请参见NodePoolInfo语法和NodePoolInfo属性。 |
TeeConfig | Map | 否 | 否 | 加密计算集群配置。 | 更多信息,请参见TeeConfig语法和TeeConfig属性。 |
TeeConfig语法
"TeeConfig": {
"TeeEnable": Boolean
}
TeeConfig属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
TeeEnable | Boolean | 是 | 否 | 是否开启加密计算集群。 | 取值:
|
NodePoolInfo语法
"NodePoolInfo": {
"ResourceGroupId": String,
"Name": String
}
NodePoolInfo属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Name | String | 是 | 否 | 节点池名称。 | 无 |
ResourceGroupId | String | 否 | 否 | 节点池所属的资源组ID。 | 无 |
KubernetesConfig语法
"KubernetesConfig": {
"CpuPolicy": String,
"Runtime": String,
"CmsEnabled": Boolean,
"UserData": String,
"NodeNameMode": String,
"RuntimeVersion": String,
"Labels": List,
"Unschedulable": Boolean,
"Taints": List
}
KubernetesConfig属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Runtime | String | 是 | 是 | 容器运行时的名称。 | 无 |
RuntimeVersion | String | 是 | 是 | 容器运行时版本。 | 无 |
CpuPolicy | String | 否 | 是 | 节点CPU管理策略。 | 当集群版本在1.12.6及以上时,支持以下两种策略:
|
CmsEnabled | Boolean | 否 | 是 | 是否在ECS节点上安装云监控。 | 安装云监控后,可以在云监控控制台查看所创建ECS实例的监控信息。推荐开启。 取值:
|
NodeNameMode | String | 否 | 否 | 自定义节点名。 | 节点名称由三部分组成:前缀+节点IP地址子串+后缀。
|
Labels | List | 否 | 是 | 节点标签,为Kubernetes集群节点添加标签。 | |
UserData | String | 否 | 是 | 节点自定义数据。 | 无 |
Unschedulable | Boolean | 否 | 是 | 是否调度新添加的节点。 | 取值:
|
Taints | List | 否 | 否 | 污点配置。 |
Labels语法
"Labels": [
{
"Value": String,
"Key": String
}
]
Labels属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Value | String | 是 | 是 | 标签值。 | 无 |
Key | String | 是 | 是 | 标签键。 | 无 |
Taints语法
"Taints": [
{
"Value": String,
"Effect": String,
"Key": String
}
]
Taints属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Value | String | 是 | 否 | 污点值。 | 无 |
Key | String | 是 | 否 | 污点名称。 | 无 |
Effect | String | 否 | 否 | 调度策略。 | 取值:
|
Management语法
"Management": {
"UpgradeConfig": Map,
"AutoRepair": Boolean,
"Enable": Boolean
}
Management属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Enable | Boolean | 是 | 否 | 是否启用托管节点池。 | 取值:
|
AutoRepair | Boolean | 否 | 否 | 是否启用自动修复。 | 此参数仅在Enable取值为true时生效。 取值:
|
UpgradeConfig | Map | 否 | 否 | 自动升级的配置。 | 该属性仅在Enable取值为true时生效。 更多信息,请参见UpgradeConfig语法和UpgradeConfig属性。 |
UpgradeConfig语法
"UpgradeConfig": {
"AutoUpgrade": Boolean,
"SurgePercentage": Integer,
"Surge": Integer,
"MaxUnavailable": Integer
}
UpgradeConfig属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
AutoUpgrade | Boolean | 否 | 否 | 是否启用自动升级。 | 取值:
|
SurgePercentage | Integer | 否 | 否 | 额外节点比例。 | SurgePercentage和Surge只能指定其中一个。 |
Surge | Integer | 否 | 否 | 额外节点数量。 | SurgePercentage和Surge只能指定其中一个。 |
MaxUnavailable | Integer | 否 | 否 | 最大不可用节点数量。 | 取值范围:1~1000。默认值:1。 |
AutoScaling语法
"AutoScaling": {
"EipBandwidth": Integer,
"Type": String,
"IsBondEip": Boolean,
"MinInstances": Integer,
"Enable": Boolean,
"MaxInstances": Integer,
"EipInternetChargeType": String
}
AutoScaling属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Enable | Boolean | 是 | 否 | 是否启用自动伸缩。 | 取值:
|
EipBandwidth | Integer | 否 | 否 | EIP带宽峰值。 | 无 |
EipInternetChargeType | String | 否 | 否 | EIP计费类型。 | 取值:
|
IsBondEip | Boolean | 否 | 否 | 是否绑定EIP。 | 取值:
|
MinInstances | Integer | 否 | 否 | 自动伸缩组最小实例数。 | 无 |
MaxInstances | Integer | 否 | 否 | 自动伸缩组最大实例数。 | 无 |
Type | String | 否 | 否 | 自动伸缩类型。 | 取值(按照自动伸缩实例类型):
|
ScalingGroup语法
"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属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
InstanceTypes | List | 是 | 是 | 抢占式实例规格。 | 无 |
SystemDiskSize | Integer | 是 | 否 | 节点的系统磁盘大小。 | 单位:GiB。取值范围:40~500。 |
VSwitchIds | List | 是 | 否 | 交换机ID。 | 无 |
AutoRenew | Boolean | 否 | 否 | 节点池节点是否开启自动续费。 | 当InstanceChargeType取值为PrePaid时生效。 取值:
|
AutoRenewPeriod | Integer | 否 | 否 | 节点池节点自动续费周期。 | 当InstanceChargeType取值为PrePaid,且AutoRenew取值为true时,AutoRenewPeriod生效且为必选值。 当PeriodUnit取值为Month时,取值:
|
CompensateWithOnDemand | Boolean | 否 | 否 | 当MultiAzPolicy取值为COST_OPTIMIZED时,如果因价格、库存等原因无法创建足够的抢占式实例,是否允许自动尝试创建按量实例满足ECS实例数量要求。 | 取值:
|
DataDisks | List | 否 | 否 | 节点池节点数据盘配置。 | 更多信息,请参见DataDisks语法和DataDisks属性。 |
InstanceChargeType | String | 否 | 是 | 节点池节点付费类型。 | 取值:
|
ImageId | String | 否 | 否 | 自定义镜像ID。 | 默认使用系统提供的镜像。 |
OnDemandPercentageAboveBaseCapacity | Integer | 否 | 否 | 伸缩组满足OnDemandBaseCapacity要求后,超出的实例中按量实例应占的比例。 | 取值范围:0~100。 |
OnDemandBaseCapacity | Integer | 否 | 否 | 伸缩组所需要按量实例个数的最小值。 | 取值范围:0~1000。当按量实例个数少于该值时,将优先创建按量实例。 |
Platform | String | 否 | 否 | 操作系统。 | 取值:
|
Period | Integer | 否 | 是 | 节点池节点自动续费周期,当选择预付费和自动续费时才生效,且为必选值。 | 当PeriodUnit取值为Month时,取值:
|
PeriodUnit | String | 否 | 是 | 节点池节点付费周期。 | 当InstanceChargeType取值为PrePaid的时候需要指定周期。 取值:
|
LoginPassword | String | 否 | 否 | SSH登录密码。 | KeyPair和LoginPassword仅能指定其中一个。 密码规则为8~30个字符,且至少包含英文字母、数字和特殊符号 |
MultiAzPolicy | String | 否 | 否 | 多可用区伸缩组ECS实例扩容和缩容策略。 | 取值:
|
KeyPair | String | 否 | 否 | 免密登录密钥对名称。 | KeyPair和LoginPassword仅能指定其中一个。 说明 如果创建托管节点池,则只支持KeyPair。 |
SecurityGroupId | String | 否 | 否 | 安全组ID。 | 无 |
SpotInstanceRemedy | Boolean | 否 | 否 | 是否使用抢占式实例。 | 取值:
更多信息,请参见使用抢占式实例。 |
SystemDiskPerformanceLevel | String | 否 | 否 | 设置云盘的性能等级。 | 取值:
更多信息,请参见ESSD云盘。 |
SpotStrategy | String | 否 | 否 | 抢占式实例类型。 | 取值:
更多信息,请参见使用抢占式实例。 |
SpotPriceLimit | List | 否 | 否 | 设置实例的每小时最高价格。 | 最大支持3位小数,SpotStrategy取值为SpotWithPriceLimit时生效。 更多信息,请参见SpotPriceLimit语法和SpotPriceLimit属性。 |
SpotInstancePools | Integer | 否 | 否 | 指定可用实例规格的个数,伸缩组将按成本最低的多个规格均衡创建抢占式实例。 | 取值范围:1~10。 |
ScalingPolicy | String | 否 | 否 | 伸缩组模式。 | 取值:
|
SystemDiskCategory | String | 否 | 是 | 节点系统盘类型。 | 取值:
|
InternetChargeType | String | 否 | 否 | 公网计费类型。 | 取值:
|
InternetMaxBandwidthOut | Integer | 否 | 否 | 公网出带宽最大值。 | 单位:Mbit/s。 取值范围:1 Mbit/s~100 Mbit/s。 |
RdsInstances | List | 否 | 否 | RDS实例ID。 | 无 |
Tags | List | 否 | 是 | 仅为ECS实例添加标签。 | 标签键不可以重复,最大长度为128个字符;标签键和标签值都不能以 |
ZoneIds | List | 否 | 否 | 可用区ID列表。 | 无 |
DataDisks语法
"DataDisks": [
{
"Category": String,
"Encrypted": Boolean,
"PerformanceLevel": String,
"Size": Integer,
"AutoSnapshotPolicyId": String
}
]
DataDisks属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
AutoSnapshotPolicyId | String | 否 | 否 | 选择自动快照策略ID,云盘会按照快照策略自动备份。 | 默认值为空,表示不自动备份。 |
Category | String | 否 | 否 | 数据盘类型。 | 取值:
|
Encrypted | Boolean | 否 | 否 | 是否对数据盘加密。 | 取值:
|
PerformanceLevel | String | 否 | 否 | 设置云盘的性能等级。 | 取值:
更多信息,请参见ESSD云盘。 |
Size | Integer | 否 | 否 | 数据盘大小。 | 取值范围:40~32768。 默认值:120。 单位:GiB。 |
SpotPriceLimit语法
"SpotPriceLimit": [
{
"PriceLimit": Number,
"InstanceType": String
}
]
SpotPriceLimit属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
PriceLimit | Number | 是 | 否 | 可抢占实例的价格限制。 | 无 |
InstanceType | String | 是 | 否 | 可抢占实例的实例类型。 | 无 |
Tags语法
"Tags": [
{
"Value": String,
"Key": String
}
]
Tags属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Value | String | 是 | 是 | 标签值。 | 无 |
Key | String | 是 | 是 | 标签键。 | 无 |
返回值
Fn::GetAtt
NodePoolId:集群节点池ID。
示例
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
{
"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"
]
}
}
}
}