ALIYUN::CS::ServerlessKubernetesCluster类型用于创建Serverless Kubernetes集群实例。

语法

{
  "Type": "ALIYUN::CS::ServerlessKubernetesCluster",
  "Properties": {
    "VpcId": String,
    "Name": String,
    "Tags": List,
    "ZoneId": String,
    "PrivateZone": Boolean,
    "VSwitchId": String,
    "NatGateway": Boolean
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
VpcId String 专有网络ID。如果不设置,系统会自动创建专有网络,系统创建的专有网络网段为192.168.0.0/16。 VpcId和VSwitchId只能同时为空或者同时都设置对应的值。
Name String 集群名称 必须以数字或英文字母开头,可包含大写字母、小写字母、中文字符、数字、短划线(-)。
Tags List 集群标签
ZoneId String 可用区
PrivateZone Boolean 是否开启PrivateZone用于服务发现。 取值:
  • true
  • false(默认值)
详情请参见Serverless集群基于云解析 PrivateZone 的服务发现
VSwitchId String 交换机ID。如果不设置,系统会自动创建交换机,系统创建的交换机网段为192.168.0.0/16。 VpcId和VSwitchId只能同时为空或者同时都设置对应的值。
NatGateway Boolean 是否创建NAT网关 取值:
  • true
  • false(默认值)

Tags语法

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

Tags属性

属性名称 类型 必须 允许更新 描述 约束
Key String 标签键 长度为1~64个字符,不能以aliyunacs:https://http://开头。
Value String 标签值 长度为0~128个字符,不能以aliyunacs:https://http://开头。

返回值

Fn::GetAtt

  • ClusterId:集群ID。
  • TaskId:任务ID。系统自动分配,用于查询任务状态。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "ServerlessKubernetesCluster": {
      "Type": "ALIYUN::CS::ServerlessKubernetesCluster",
      "Properties": {
        "VpcId": {
          "Ref": "VpcId"
        },
        "Name": {
          "Ref": "Name"
        },
        "Tags": {
          "Ref": "Tags"
        },
        "ZoneId": {
          "Ref": "ZoneId"
        },
        "PrivateZone": {
          "Ref": "PrivateZone"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "NatGateway": {
          "Ref": "NatGateway"
        }
      }
    }
  },
  "Parameters": {
    "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."
    },
    "Name": {
      "Type": "String",
      "Description": "The name of the cluster. The cluster name can use uppercase and lowercase letters, Chinese characters, numbers, and dashes."
    },
    "Tags": {
      "Type": "Json",
      "Description": "Tag the cluster."
    },
    "ZoneId": {
      "Type": "String",
      "Description": "The zone ID."
    },
    "PrivateZone": {
      "Type": "Boolean",
      "Description": "Whether to enable PrivateZone for service discovery.",
      "AllowedValues": [
        true,
        false
      ]
    },
    "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."
    },
    "NatGateway": {
      "Default": false,
      "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,
        false
      ]
    }
  },
  "Outputs": {
    "ClusterId": {
      "Description": "Cluster instance ID.",
      "Value": {
        "Fn::GetAtt": [
          "ServerlessKubernetesCluster",
          "ClusterId"
        ]
      }
    },
    "TaskId": {
      "Description": "Task ID. Automatically assigned by the system, the user queries the task status.",
      "Value": {
        "Fn::GetAtt": [
          "ServerlessKubernetesCluster",
          "TaskId"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  ServerlessKubernetesCluster:
    Type: 'ALIYUN::CS::ServerlessKubernetesCluster'
    Properties:
      VpcId:
        Ref: VpcId
      Name:
        Ref: Name
      Tags:
        Ref: Tags
      ZoneId:
        Ref: ZoneId
      PrivateZone:
        Ref: PrivateZone
      VSwitchId:
        Ref: VSwitchId
      NatGateway:
        Ref: NatGateway
Parameters:
  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.
  Name:
    Type: String
    Description: >-
      The name of the cluster. The cluster name can use uppercase and lowercase
      letters, Chinese characters, numbers, and dashes.
  Tags:
    Type: Json
    Description: Tag the cluster.
  ZoneId:
    Type: String
    Description: The zone ID.
  PrivateZone:
    Type: Boolean
    Description: Whether to enable PrivateZone for service discovery.
    AllowedValues:
      - true
      - false
  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.
  NatGateway:
    Default: false
    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
      - false
Outputs:
  ClusterId:
    Description: Cluster instance ID.
    Value:
      'Fn::GetAtt':
        - ServerlessKubernetesCluster
        - ClusterId
  TaskId:
    Description: >-
      Task ID. Automatically assigned by the system, the user queries the task
      status.
    Value:
      'Fn::GetAtt':
        - ServerlessKubernetesCluster
        - TaskId