ALIYUN::CS::ManagedKubernetesCluster is used to create a Container Service for Kubernetes (ACK) managed cluster.
Syntax
{
"Type": "ALIYUN::CS::ManagedKubernetesCluster",
"Properties": {
"CloudMonitorFlags": Boolean,
"ProxyMode": String,
"WorkerDataDisk": Boolean,
"SnatEntry": Boolean,
"VSwitchIds": List,
"WorkerSystemDiskCategory": String,
"VpcId": String,
"Tags": List,
"WorkerSystemDiskSize": Number,
"WorkerInstanceTypes": List,
"WorkerDataDisks": List,
"LoginPassword": String,
"ContainerCidr": String,
"NumOfNodes": Number,
"Name": String,
"Taint": List,
"KeyPair": String,
"Addons": List,
"DisableRollback": Boolean,
"ServiceCidr": String,
"KubernetesVersion": String,
"SecurityGroupId": String,
"EndpointPublicAccess": Boolean,
"ClusterSpec": String,
"TimeoutMins": Number,
"PodVswitchIds": List,
"EncryptionProviderKey": String,
"Runtime": Map,
"SocEnabled": Boolean,
"UserData": String,
"OsType": String,
"IsEnterpriseSecurityGroup": Boolean,
"Platform": String,
"AutoRenewPeriod": Number,
"LoadBalancerSpec": String,
"AutoRenew": Boolean,
"ChargeType": String,
"FormatDisk": Boolean,
"Period": Number,
"NodeCidrMask": String,
"PeriodUnit": String,
"KeepInstanceName": Boolean,
"DeletionProtection": Boolean,
"ZoneIds": List,
"ResourceGroupId": String,
"NodePools": List,
"NodeNameMode": String,
"SecurityHardeningOs": Boolean,
"WorkerSystemDiskPerformanceLevel": String,
"DeleteOptions": List
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
Name | String | Yes | No | The cluster name. | The name must be 1 to 63 characters in length, and can contain letters, digits, and hyphens (-). |
VpcId | String | Yes | No | The ID of the virtual private cloud (VPC). | If you do not specify this property, the system automatically creates a VPC whose CIDR block is 192.168.0.0/16. You must specify the |
VSwitchIds | List | Yes | No | The vSwitch IDs of the worker nodes. | You can specify one to three vSwitch IDs. |
Addons | List | No | Yes | The components that you want to use for the cluster. |
For more information, see Addons properties. |
AutoRenew | Boolean | No | No | Specifies whether to enable auto-renewal. | This property takes effect when ChargeType is set to PrePaid. Valid values:
|
SecurityHardeningOs | Boolean | No | No | Specifies whether to enable security hardening for Alibaba Cloud Linux. | Valid values:
Default value: false. |
WorkerSystemDiskPerformanceLevel | String | No | No | The system disk performance level (PL) of the worker nodes. | Valid values:
|
AutoRenewPeriod | Number | No | No | The auto-renewal period. | This property takes effect when ChargeType is set to PrePaid and AutoRenew is set to true.
Default value: 1. |
ChargeType | String | No | No | The billing method. | Valid values:
|
CloudMonitorFlags | Boolean | No | No | Specifies whether to install the CloudMonitor agent. | Valid values:
|
ClusterSpec | String | No | No | The type of the ACK managed cluster. | Valid values:
|
ContainerCidr | String | No | No | The CIDR block of the container. | The CIDR block of the container cannot overlap with the CIDR block of the VPC. If you use the VPC that is automatically created by the system, 172.16.0.0/16 is used as the container CIDR block by default. |
DeletionProtection | Boolean | No | No | Specifies whether to enable deletion protection. | After you enable deletion protection, you cannot delete the cluster by using the ACK console or by calling specific ACK API operations. Valid values:
|
DisableRollback | Boolean | No | No | Specifies whether to disable rollback for resources if the cluster fails to be created. | Valid values:
|
EncryptionProviderKey | String | No | No | The ID of the key that is managed by Key Management Service (KMS). | The key is used to encrypt data disks. You can use KMS only for ACK Pro clusters. |
EndpointPublicAccess | Boolean | No | No | Specifies whether to allow the cluster to access the API server over the Internet. | Valid values:
|
FormatDisk | Boolean | No | No | Specifies whether to attach a data disk to a node that is created based on an existing Elastic Compute Service (ECS) instance. | Valid values:
|
IsEnterpriseSecurityGroup | Boolean | No | No | Specifies whether to create an advanced security group. | This property takes effect when SecurityGroupId is left empty. Valid values:
|
KeepInstanceName | Boolean | No | No | Specifies whether to retain the names of existing ECS instances in the cluster. | Valid values:
|
KeyPair | String | No | No | The name of the key pair. | You can specify KeyPair or LoginPassword. |
KubernetesVersion | String | No | Yes | The Kubernetes version of the cluster. ACK supports the same Kubernetes versions as open source Kubernetes. We recommend that you use the latest version. | You can create clusters of the latest two versions. For more information about the Kubernetes versions supported by ACK, see Overview of Kubernetes versions supported by ACK. |
LoadBalancerSpec | String | No | No | The specification of the Server Load Balancer (SLB) instance. | Valid values:
|
LoginPassword | String | No | No | The password for SSH logons. | The password must be 8 to 30 characters in length, and must contain letters, digits, and special characters. The following special characters are supported: Note You can specify LoginPassword or KeyPair. |
NodeCidrMask | String | No | No | The maximum number of CIDR blocks that can be assigned to the nodes. | The value of this property varies based on the pod CIDR block. This property takes effect only when you use the Flannel component in the cluster. Default value: 25. |
NodeNameMode | String | No | No | The custom name of the node. | A node name consists of a prefix, an IP address substring, and a suffix.
For example, if the node IP address is 192.168.XX.XX, the prefix is |
NodePools | List | No | No | The information about the node pools. | For more information, see NodePools properties. |
NumOfNodes | Number | No | Yes | The number of worker nodes. | Valid values: 0 to 300. Default value: 3. |
OsType | String | No | No | The OS type. | Valid values:
|
Period | Number | No | No | The subscription duration of the cluster. | You must specify this property when ChargeType is set to PrePaid.
Default value: 1. |
PeriodUnit | String | No | No | The unit of the subscription duration of the cluster. | This property takes effect when ChargeType is set to PrePaid. Valid values:
|
Platform | String | No | No | The OS distribution. | Valid values:
|
PodVswitchIds | List | No | No | The pod vSwitches. | For each node vSwitch, you must specify at least one pod vSwitch that is deployed in the same zone as the node vSwitch. The pod vSwitch cannot overlap with the node vSwitch. We recommend that you use a vSwitch whose CIDR block mask is no greater than 19 bits in length. Note You must specify this property when you install the Terway component in the cluster. |
ProxyMode | String | No | No | The kube-proxy mode. | Valid values:
|
ResourceGroupId | String | No | Yes | The ID of the resource group to which the cluster belongs. | None. |
Runtime | Map | No | No | The container runtime. | The Runtime property consists of the following fields:
Example:
For more information about how to select a container runtime, see Comparison among Docker, containerd, and Sandboxed-Container. For more information, see DeleteOptions properties. |
SecurityGroupId | String | No | No | The ID of the security group to which the ECS instances in the cluster belong. | None. |
ServiceCidr | String | No | No | The Service CIDR block. | The Service CIDR block cannot overlap with the VPC CIDR block or container CIDR block. If you use the VPC that is automatically created by the system, 172.19.0.0/20 is used as the Service CIDR block by default. |
SnatEntry | Boolean | No | No | Specifies whether to configure SNAT rules for the VPC. |
|
SocEnabled | Boolean | No | No | Specifies whether to enable reinforcement based on classified protection. | Valid values:
|
Tags | List | No | Yes | The tags of the cluster. | You can add up to 20 tags. For more information, see Tags properties. |
Taint | List | No | No | The taints that you want to add to nodes for scheduling of pods. | If you apply tolerations to pods, the pods can be scheduled to nodes that have matching taints. |
TimeoutMins | Number | No | No | The timeout period for creating the cluster. | Default value: 60. Unit: minutes. |
UserData | String | No | No | The user data that you specify when you create the ECS instances. | The user data can be up to 16 KB in size. You do not need to convert the data into Base64-encoded strings. If the user data contains special characters, you must add the escape character (\) before each special character. |
WorkerDataDisk | Boolean | No | No | Specifies whether to attach data disks to worker nodes. | Valid values:
|
WorkerDataDisks | List | No | Yes | The configurations of the data disks that you want to attach to worker nodes. The configurations include disk categories and disk sizes. | This property takes effect only when you attach data disks to worker nodes. For more information, see WorkerDataDisks properties. |
WorkerInstanceTypes | List | No | Yes | The ECS instance types of the worker nodes. | For more information, see Overview of instance families. |
WorkerSystemDiskCategory | String | No | No | The system disk category of the worker nodes. | Valid values:
|
WorkerSystemDiskSize | Number | No | No | The system disk size of the worker nodes. | Default value: 120. Unit: GiB. |
ZoneIds | List | No | No | The zones to which the vSwitches of the worker nodes belong. | None. |
DeleteOptions | List | No | Yes | The options for deleting or retaining resources associated with the cluster. | For more information, see DeleteOptions properties. |
NodePools syntax
"NodePools": [
{
"ScalingGroup": Map,
"KubernetesConfig": Map,
"NodePoolInfo": Map,
"Count": Integer
}
]
NodePools properties
Property | Type | Required | Editable | Description | Constraint |
ScalingGroup | Map | Yes | No | The configurations of the scaling group that you want to use for the node pool. | For more information, see ScalingGroup properties. |
Count | Integer | No | No | The number of nodes in the node pool. | None. |
KubernetesConfig | Map | No | No | The configurations of the cluster. | For more information, see KubernetesConfig properties. |
NodePoolInfo | Map | No | No | The configurations of the node pool. | For more information, see NodePoolInfo properties. |
ScalingGroup syntax
"ScalingGroup": {
"RdsInstances": List,
"IsEnterpriseSecurityGroup": Boolean,
"VSwitchIds": List,
"InternetMaxBandwidthOut": Integer,
"DataDisks": List,
"Period": Integer,
"InternetChargeType": String,
"KeyPair": String,
"SystemDiskPerformanceLevel": String,
"ImageId": String,
"Platform": String,
"InstanceTypes": List,
"SystemDiskCategory": String,
"PeriodUnit": String,
"LoginPassword": String,
"InstanceChargeType": String,
"SystemDiskSize": Integer,
"Tags": List,
"ZoneIds": List
}
ScalingGroup properties
Property | Type | Required | Editable | Description | Constraint |
InstanceTypes | List | Yes | No | The instance types. | None. |
SystemDiskSize | Integer | Yes | No | The system disk size of the nodes. | Unit: GiB. Valid values: 40 to 500. |
VSwitchIds | List | Yes | No | The IDs of the vSwitches. | None. |
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 properties. |
ImageId | String | No | No | The ID of the custom image. | By default, the image that is provided by the system is used. |
InstanceChargeType | String | No | No | The billing method of the nodes in the node pool. | Valid values:
|
InternetChargeType | String | No | No | The metering method of the public IP address. | Valid values:
|
InternetMaxBandwidthOut | Integer | No | No | The maximum outbound bandwidth of the public IP address of the node. | Unit: Mbit/s. Valid values: 1 to 100. |
IsEnterpriseSecurityGroup | Boolean | No | No | Specifies whether to automatically create and use an advanced security group. | Valid values:
|
KeyPair | String | No | No | The name of the key pair that is used for password-free logons. | You can specify KeyPair or LoginPassword. |
LoginPassword | String | No | No | The password for SSH logons. | You can specify KeyPair or LoginPassword. The password must be 8 to 30 characters in length, and must contain at least uppercase letters, lowercase letters, digits, and special characters. |
Period | Integer | No | No | The subscription duration of the nodes in the node pool. | You must specify this property only when InstanceChargeType is set to PrePaid. Valid values of Period when PeriodUnit is set to Month: 1, 2, 3, 6, and 12. Default value: 1. |
PeriodUnit | String | No | No | The unit of the subscription duration of the nodes in the node pool. | You must specify this property when InstanceChargeType is set to PrePaid. Set the value of PeriodUnit to Month. |
Platform | String | No | No | The OS distribution. | Valid values:
|
RdsInstances | List | No | No | The IDs of the ApsaraDB RDS instances. | None. |
SystemDiskCategory | String | No | No | The system disk category of the nodes. | Valid values:
|
SystemDiskPerformanceLevel | String | No | No | The system disk PL of the nodes. | This property takes effect only for ESSDs. |
Tags | List | No | No | The tags that you want to add to the ECS instances. | For more information, see Tags properties. |
ZoneIds | List | No | No | The zones. | None. |
DataDisks syntax
"DataDisks": [
{
"AutoSnapshotPolicyId": String,
"Encrypted": Boolean,
"Size": Integer,
"Category": String,
"PerformanceLevel": String
}
]
DataDisks properties
Property | Type | Required | Editable | Description | Constraint |
AutoSnapshotPolicyId | String | No | No | The ID of the automatic snapshot policy. | The system automatically backs up cloud disks based on the specified automatic snapshot policy. |
Category | String | No | No | The data disk category. | Valid values:
|
Encrypted | Boolean | No | No | Specifies whether to encrypt data disks. | Valid values:
|
PerformanceLevel | String | No | No | The data disk PL of the nodes. | This property takes effect only for ESSDs. The PL of a disk varies based on the disk size. For more information, see ESSDs. |
Size | Integer | No | No | The data disk size. | Unit: GiB. Valid values: 40 to 32768. Default value: 120. |
KubernetesConfig syntax
"KubernetesConfig": {
"Runtime": String,
"RuntimeVersion": String,
"CpuPolicy": String,
"Labels": List,
"NodeNameMode": String,
"Taints": List
}
KubernetesConfig properties
Property | Type | Required | Editable | Description | Constraint |
Runtime | String | Yes | No | The container runtime. | None. |
RuntimeVersion | String | Yes | No | The version of the container runtime. | None. |
CpuPolicy | String | No | No | The CPU management policy of the node. | Valid values when the Kubernetes version of the cluster is 1.12.6 or later:
|
Labels | List | No | No | The labels of the nodes. | You can add labels to the nodes in the cluster. For more information, see the "Labels properties" section of this topic. |
NodeNameMode | String | No | No | The custom name of the node. | A node name consists of a prefix, an IP address substring, and a suffix.
For example, if the node IP address is 192.168.XX.XX, the prefix is |
Taints | List | No | No | The configurations of the taints. | For more information, see Taints properties. |
Labels syntax
"Labels": {
"Value": String,
"Key": String
}
Labels properties
Property | Type | Required | Editable | Description | Constraint |
Key | String | Yes | No | The label key. | None. |
Value | String | Yes | No | The label value. | None. |
Taints syntax
"Taints": [{
"Value": String,
"Effect": String,
"Key": String
}]
Taints properties
Property | Type | Required | Editable | Description | Constraint |
Key | String | Yes | No | The taint name. | None. |
Value | String | Yes | No | The taint value. | None. |
Effect | String | No | No | The scheduling policy. |
|
NodePoolInfo syntax
"NodePoolInfo": {
"Name": String,
"Type": String,
"ResourceGroupId": String
}
NodePoolInfo properties
Property | Type | Required | Editable | Description | Constraint |
Name | String | Yes | No | The name of the node pool. | None. |
Type | String | No | No | The type of the node pool. | Valid values:
|
ResourceGroupId | String | No | Yes | The resource group to which the node pool belongs. | None. |
Tags syntax
"Tags": [
{
"Key": String,
"Value": String
}
]
Tags properties
Property | Type | Required | Editable | Description | Constraint |
Key | String | Yes | No | The tag key. | The tag key must be 1 to 64 characters in length, and cannot start with |
Value | String | Yes | No | The tag value. | The tag value can be up to 128 characters in length, and cannot start with |
WorkerDataDisks syntax
"WorkerDataDisks": [
{
"Category": String,
"Size": Number,
"PerformanceLevel": String
}
]
WorkerDataDisks properties
Property | Type | Required | Editable | Description | Constraint |
Category | String | Yes | Yes | The data disk category of the worker node. | Valid values:
|
PerformanceLevel | String | No | No | The PL of the ESSD. | Valid values:
|
Size | Number | Yes | Yes | The data disk size. | Valid values: 40 to 32768. Unit: GiB. |
Addons syntax
"Addons": [
{
"Version": String,
"Config": String,
"Name": String,
"Disabled": Boolean
}
]
Addons properties
Property | Type | Required | Editable | Description | Constraint |
Name | String | Yes | No | The component name. | None. |
Config | String | No | Yes | The configurations of the component. | None. |
Disabled | Boolean | No | No | Specifies whether to disable default installation for the component. | Valid values:
|
Version | String | No | No | The version of the component. | By default, the latest version is used. |
DeleteOptions syntax
"DeleteOptions": [
{
"DeleteMode": String,
"ResourceType": String
}
]
DeleteOptions properties
Property | Type | Required | Editable | Description | Constraint |
DeleteMode | String | No | Yes | The deletion policy for the specified type of resources. | Valid values:
|
ResourceType | String | No | Yes | The type of the resources. | Valid values:
|
Runtime syntax
"Runtime": {
"Name": String,
"Version": String
}
Runtime properties
Property | Type | Required | Editable | Description | Constraint |
Name | String | Yes | No | The name of the container runtime. | ACK supports the following types of container runtimes:
Default value: |
Version | String | No | No | The version of the container runtime. | By default, the latest version is used. For more information, see Release notes for Sandboxed-Container. |
Return values
Fn::GetAtt
ClusterId: the cluster ID.
TaskId: the task ID. The task ID is automatically assigned by the system and is used to query the status of the task.
WorkerRamRoleName: the name of the Resource Access Management (RAM) role for the worker nodes.
DefaultUserKubeConfig: the default kubeconfig file of the cluster credentials.
ScalingRuleId: the ID of the scaling rule.
ScalingGroupId: the ID of the scaling group.
PrivateUserKubConfig: the private kubeconfig file of the cluster credentials.
ScalingConfigurationId: the ID of the scaling configuration.
Nodes: the nodes in the cluster.
APIServerSLBId: the ID of the SLB instance that is associated with the API server.
IngressSLBId: the ID of the SLB Ingress.
Examples
YAML
format
ROSTemplateFormatVersion: '2015-09-01'
Description: Test Create ManagedKubernetesCluster
Parameters: {}
Resources:
Vpc:
Type: ALIYUN::ECS::VPC
Properties:
VpcName: mytest
CidrBlock: 192.168.0.0/16
VSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
VSwitchName: mytest
VpcId:
Ref: Vpc
ZoneId:
Fn::Select:
- '0'
- Fn::GetAZs:
Ref: ALIYUN::Region
CidrBlock: 192.168.1.0/24
ManagedKubernetesCluster:
Type: ALIYUN::CS::ManagedKubernetesCluster
Properties:
VSwitchIds:
- Ref: VSwitch
VpcId:
Ref: Vpc
ClusterSpec: ack.pro.small
WorkerInstanceTypes:
- ecs.c5.large
WorkerSystemDiskCategory: cloud_essd
LoginPassword: Admin@123!
Name: mytest
Outputs:
ClusterId:
Value:
Fn::GetAtt:
- ManagedKubernetesCluster
- ClusterId
TaskId:
Value:
Fn::GetAtt:
- ManagedKubernetesCluster
- TaskId
JSON
format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": "Test Create ManagedKubernetesCluster",
"Parameters": {
},
"Resources": {
"Vpc": {
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"VpcName": "mytest",
"CidrBlock": "192.168.0.0/16"
}
},
"VSwitch": {
"Type": "ALIYUN::ECS::VSwitch",
"Properties": {
"VSwitchName": "mytest",
"VpcId": {
"Ref": "Vpc"
},
"ZoneId": {
"Fn::Select": [
"0",
{
"Fn::GetAZs": {
"Ref": "ALIYUN::Region"
}
}
]
},
"CidrBlock": "192.168.1.0/24"
}
},
"ManagedKubernetesCluster": {
"Type": "ALIYUN::CS::ManagedKubernetesCluster",
"Properties": {
"VSwitchIds": [
{
"Ref": "VSwitch"
}
],
"VpcId": {
"Ref": "Vpc"
},
"ClusterSpec": "ack.pro.small",
"WorkerInstanceTypes": [
"ecs.c5.large"
],
"WorkerSystemDiskCategory": "cloud_essd",
"LoginPassword": "Admin@123!",
"Name": "mytest"
}
}
},
"Outputs": {
"ClusterId": {
"Value": {
"Fn::GetAtt": [
"ManagedKubernetesCluster",
"ClusterId"
]
}
},
"TaskId": {
"Value": {
"Fn::GetAtt": [
"ManagedKubernetesCluster",
"TaskId"
]
}
}
}
}