ALIYUN::CS::ServerlessKubernetesCluster类型用于创建Serverless Kubernetes集群实例。
语法
{
"Type": "ALIYUN::CS::ServerlessKubernetesCluster",
"Properties": {
"VpcId": String,
"Name": String,
"Tags": List,
"ZoneId": String,
"PrivateZone": Boolean,
"VSwitchId": String,
"EndpointPublicAccess": Boolean,
"SecurityGroupId": String,
"VSwitchIds": List,
"ServiceCidr": String,
"Addons": List,
"KubernetesVersion": String,
"NatGateway": Boolean
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
VpcId | String | 否 | 否 | 专有网络ID。如果不设置,系统会自动创建专有网络,系统创建的专有网络网段为192.168.0.0/16。 | VpcId和VSwitchId只能同时为空或者同时都设置对应的值。 |
Name | String | 是 | 否 | 集群名称。 | 必须以数字或英文字母开头。可包含英文字母、汉字、数字和短划线(-)。 |
Tags | List | 否 | 否 | 集群标签。 | 更多信息,请参见Tags属性。 |
ZoneId | String | 否 | 否 | 可用区。 | 无 |
PrivateZone | Boolean | 否 | 否 | 是否开启PrivateZone用于服务发现。 | 取值:
更多信息,请参见Serverless集群基于云解析PrivateZone的服务发现。 |
VSwitchId | String | 否 | 否 | 交换机ID。如果不设置,系统会自动创建交换机,系统创建的交换机网段为192.168.0.0/16。 | VpcId和VSwitchId只能同时为空或者同时都设置对应的值。 |
EndpointPublicAccess | Boolean | 否 | 否 | 是否开启公网API Server。 | 取值:
|
SecurityGroupId | String | 否 | 否 | 集群ECS实例所属的安全组ID。 | 无 |
VSwitchIds | List | 否 | 否 | 交换机ID列表。若不设置,系统会自动创建交换机,系统自动创建的交换机网段为192.168.0.0/16。 | 最多支持10个交换机ID。 |
ServiceCidr | String | 否 | 否 | 服务网段。 | 不能和专有网络网段以及容器网段冲突。
当选择系统自动创建专有网络时,默认使用172.19.0.0/20网段。 |
Addons | List | 否 | 否 | 集群安装的组件列表。 | 取值:
更多信息,请参见Addons属性。 |
KubernetesVersion | String | 否 | 否 | 集群版本。 | 取值:
|
NatGateway | Boolean | 否 | 否 | 是否创建NAT网关。 | 取值:
|
Tags语法
"Tags": [
{
"Key": String,
"Value": String
}
]
Tags属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
Key | String | 是 | 否 | 标签键。 | 长度为1~64个字符,不能以aliyun 、acs: 、https:// 或http:// 开头。 |
Value | String | 否 | 否 | 标签值。 | 长度为0~128个字符,不能以aliyun 、acs: 、https:// 或http:// 开头。 |
Addons语法
"Addons": [
{
"Disabled": String,
"Config": String,
"Name": String
}
]
Addons属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
Disabled | Boolean | 否 | 否 | 是否禁止默认安装组件。 | 取值:
|
Config | String | 否 | 否 | 组件的配置。 | 取值为空时表示无需配置。 |
Name | String | 是 | 否 | 组件的名称。 | 无 |
返回值
Fn::GetAtt
- ClusterId:集群ID。
- TaskId:任务ID。系统自动分配,用于查询任务状态。
- WorkerRamRoleName:Worker节点RAM角色名称。
示例
JSON
格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"KubernetesVersion": {
"Type": "String",
"Description": "Kubernetes version. Default to 1.14.8-aliyun.1, 1.16.9-aliyun.1 and so on .",
"Default": "1.14.8-aliyun.1"
},
"EndpointPublicAccess": {
"Type": "Boolean",
"Description": "Whether to enable the public network API Server:\ntrue: which means that the public network API Server is open.\nfalse: If set to false, the API server on the public network will not be created, only the API server on the private network will be created.",
"AllowedValues": [
"True",
"true",
"False",
"false"
]
},
"ZoneId": {
"Type": "String",
"Description": "The zone ID."
},
"VSwitchIds": {
"Type": "CommaDelimitedList",
"Description": "The IDs of VSwitches. If you leave this property empty, the system automatically creates a VSwitch.\nNote You must specify both the VpcId and VSwitchIds or leave both of them empty.",
"MinLength": 1,
"MaxLength": 10
},
"SecurityGroupId": {
"Type": "String",
"Description": "Specifies the ID of the security group to which the cluster ECS instance belongs."
},
"VSwitchId": {
"Type": "String",
"Description": "If not set, the system will automatically create a switch, and the network segment of the switch created by the system is 192.168.0.0/18."
},
"Addons": {
"Type": "Json",
"Description": "The add-ons to be installed for the cluster."
},
"NatGateway": {
"Type": "Boolean",
"Description": "Whether to create a NAT gateway. The value can be true or false. If not set, the system defaults to false.",
"AllowedValues": [
"True",
"true",
"False",
"false"
],
"Default": false
},
"Name": {
"Type": "String",
"Description": "The name of the cluster. The cluster name can use uppercase and lowercase letters, Chinese characters, numbers, and dashes."
},
"VpcId": {
"Type": "String",
"Description": "VPC ID. If not set, the system will automatically create a VPC, and the VPC network segment created by the system is 192.168.0.0/16. \nVpcId and VSwitchId can only be empty at the same time or set the corresponding values at the same time."
},
"ServiceCidr": {
"Type": "String",
"Description": "The service network segment cannot conflict with the VPC network segment and the container network segment. When the system is selected to automatically create a VPC, the network segment 172.19.0.0/20 is used by default.",
"Default": "172.19.0.0/20"
},
"Tags": {
"Type": "Json",
"Description": "Tag the cluster."
},
"PrivateZone": {
"Type": "Boolean",
"Description": "Whether to enable PrivateZone for service discovery.",
"AllowedValues": [
"True",
"true",
"False",
"false"
]
}
},
"Resources": {
"ServerlessKubernetesCluster": {
"Type": "ALIYUN::CS::ServerlessKubernetesCluster",
"Properties": {
"KubernetesVersion": {
"Ref": "KubernetesVersion"
},
"EndpointPublicAccess": {
"Ref": "EndpointPublicAccess"
},
"ZoneId": {
"Ref": "ZoneId"
},
"VSwitchIds": {
"Ref": "VSwitchIds"
},
"SecurityGroupId": {
"Ref": "SecurityGroupId"
},
"VSwitchId": {
"Ref": "VSwitchId"
},
"Addons": {
"Ref": "Addons"
},
"NatGateway": {
"Ref": "NatGateway"
},
"Name": {
"Ref": "Name"
},
"VpcId": {
"Ref": "VpcId"
},
"ServiceCidr": {
"Ref": "ServiceCidr"
},
"Tags": {
"Ref": "Tags"
},
"PrivateZone": {
"Ref": "PrivateZone"
}
}
}
},
"Outputs": {
"TaskId": {
"Description": "Task ID. Automatically assigned by the system, the user queries the task status.",
"Value": {
"Fn::GetAtt": [
"ServerlessKubernetesCluster",
"TaskId"
]
}
},
"ClusterId": {
"Description": "Cluster instance ID.",
"Value": {
"Fn::GetAtt": [
"ServerlessKubernetesCluster",
"ClusterId"
]
}
},
"WorkerRamRoleName": {
"Description": "Worker ram role name.",
"Value": {
"Fn::GetAtt": [
"ServerlessKubernetesCluster",
"WorkerRamRoleName"
]
}
}
}
}
YAML
格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
KubernetesVersion:
Type: String
Description: >-
Kubernetes version. Default to 1.14.8-aliyun.1, 1.16.9-aliyun.1 and so on
.
Default: 1.14.8-aliyun.1
EndpointPublicAccess:
Type: Boolean
Description: >-
Whether to enable the public network API Server:
true: which means that the public network API Server is open.
false: If set to false, the API server on the public network will not be
created, only the API server on the private network will be created.
AllowedValues:
- 'True'
- 'true'
- 'False'
- 'false'
ZoneId:
Type: String
Description: The zone ID.
VSwitchIds:
Type: CommaDelimitedList
Description: >-
The IDs of VSwitches. If you leave this property empty, the system
automatically creates a VSwitch.
Note You must specify both the VpcId and VSwitchIds or leave both of them
empty.
MinLength: 1
MaxLength: 10
SecurityGroupId:
Type: String
Description: >-
Specifies the ID of the security group to which the cluster ECS instance
belongs.
VSwitchId:
Type: String
Description: >-
If not set, the system will automatically create a switch, and the network
segment of the switch created by the system is 192.168.0.0/18.
Addons:
Type: Json
Description: The add-ons to be installed for the cluster.
NatGateway:
Type: Boolean
Description: >-
Whether to create a NAT gateway. The value can be true or false. If not
set, the system defaults to false.
AllowedValues:
- 'True'
- 'true'
- 'False'
- 'false'
Default: false
Name:
Type: String
Description: >-
The name of the cluster. The cluster name can use uppercase and lowercase
letters, Chinese characters, numbers, and dashes.
VpcId:
Type: String
Description: >-
VPC ID. If not set, the system will automatically create a VPC, and the
VPC network segment created by the system is 192.168.0.0/16.
VpcId and VSwitchId can only be empty at the same time or set the
corresponding values at the same time.
ServiceCidr:
Type: String
Description: >-
The service network segment cannot conflict with the VPC network segment
and the container network segment. When the system is selected to
automatically create a VPC, the network segment 172.19.0.0/20 is used by
default.
Default: 172.19.0.0/20
Tags:
Type: Json
Description: Tag the cluster.
PrivateZone:
Type: Boolean
Description: Whether to enable PrivateZone for service discovery.
AllowedValues:
- 'True'
- 'true'
- 'False'
- 'false'
Resources:
ServerlessKubernetesCluster:
Type: 'ALIYUN::CS::ServerlessKubernetesCluster'
Properties:
KubernetesVersion:
Ref: KubernetesVersion
EndpointPublicAccess:
Ref: EndpointPublicAccess
ZoneId:
Ref: ZoneId
VSwitchIds:
Ref: VSwitchIds
SecurityGroupId:
Ref: SecurityGroupId
VSwitchId:
Ref: VSwitchId
Addons:
Ref: Addons
NatGateway:
Ref: NatGateway
Name:
Ref: Name
VpcId:
Ref: VpcId
ServiceCidr:
Ref: ServiceCidr
Tags:
Ref: Tags
PrivateZone:
Ref: PrivateZone
Outputs:
TaskId:
Description: >-
Task ID. Automatically assigned by the system, the user queries the task
status.
Value:
'Fn::GetAtt':
- ServerlessKubernetesCluster
- TaskId
ClusterId:
Description: Cluster instance ID.
Value:
'Fn::GetAtt':
- ServerlessKubernetesCluster
- ClusterId
WorkerRamRoleName:
Description: Worker ram role name.
Value:
'Fn::GetAtt':
- ServerlessKubernetesCluster
- WorkerRamRoleName