ALIYUN::CS::ManagedEdgeKubernetesCluster类型用于创建Kubernetes边缘托管版集群实例。

语法

{ 
  "Type": "ALIYUN::CS::ManagedEdgeKubernetesCluster",
  "Properties": {
    "NumOfNodes": Number,
    "Profile": String,
    "VpcId": String,
    "ServiceCidr": String,
    "Name": String,
    "Tags": List,
    "ProxyMode": String,
    "DisableRollback": Boolean,
    "SnatEntry": Boolean,
    "VSwitchIds": List,
    "LoginPassword": String,
    "WorkerSystemDiskSize": Number,
    "KeyPair": String,
    "Addons": List,
    "WorkerDataDiskCategory": String,
    "EndpointPublicAccess": Boolean,
    "WorkerDataDisk": Boolean,
    "WorkerSystemDiskCategory": String,
    "WorkerDataDiskSize": Integer,
    "TimeoutMins": Number,
    "ClusterSpec": String,
    "ContainerCidr": String,
    "CloudMonitorFlags": Boolean,
    "WorkerInstanceTypes": List,
    "IsEnterpriseSecurityGroup": Boolean,
    "AutoRenewPeriod": Number,
    "ChargeType": String,
    "AutoRenew": Boolean,
    "Period": Number,
    "NodeCidrMask": String,
    "PeriodUnit": String,
    "DeletionProtection": Boolean,
    "ZoneIds": List,
    "ResourceGroupId": String,
    "WorkerDataDisks": List
  }
}

属性

属性名称类型必须允许更新描述约束
NumOfNodesNumberWorker节点数。取值范围:0~300。
ProfileString边缘集群标识。默认值:Edge。
VpcIdString专有网络ID。如果不设置,系统会自动创建专有网络,系统创建的专有网络网段为192.168.0.0/16。

VpcId和VSwitchIds只能同时为空或者同时都设置对应的值。

ServiceCidrString服务网段。不能与专有网络网段以及容器网段冲突。当选择系统自动创建专有网络时,默认使用172.19.0.0/20网段。
NameString集群名称。以英文字母或数字开头,可包含英文字母、汉字、数字和短划线(-)。
TagsList标签。最多可以设置20个标签。

更多信息,请参见Tags属性

AddonsList集群安装的组件列表。取值:
  • 网络组件

    支持Flannel和Terway两种网络类型,创建集群时需二选一:

    • Flannel网络:[{"Name":"flannel","Config":""}]
    • Terway网络:[{"Name": "terway-eniip","Config": ""}]
  • 存储组件

    支持csi和flexvolume两种类型:

    • csi:[{"Name":"csi-plugin","Config": ""},{"Name": "csi-provisioner","Config": ""}]
    • flexvolume:[{"Name": "flexvolume","Config": ""}]
  • 日志组件(可选)
    说明 如果不开启日志服务,将无法使用集群审计功能。
    • 使用已有SLS Project:[{"Name": "logtail-ds","Config": "{\"IngressDashboardEnabled\":\"true\",\"sls_project_name\":\"your_sls_project_name\"}"}]
    • 创建新的SLS Project:[{"Name": "logtail-ds","Config": "{\"IngressDashboardEnabled\":\"true\"}"}]
  • Ingress组件(可选)

    Kubernetes专有版集群默认安装Ingress组件nginx-ingress-controller。

    • 安装Ingress并且开启公网:[{"Name":"nginx-ingress-controller","Config":"{\"IngressSlbNetworkType\":\"internet\"}"}]
    • 不安装Ingress:[{"Name": "nginx-ingress-controller","Config": "","Disabled": true}]
  • 事件中心(可选,默认开启)

    事件中心提供对Kubernetes事件的存储、查询、告警等能力。Kubernetes事件中心关联的Logstore在90天内免费。更多信息,请参见创建并使用Kubernetes事件中心

    开启事件中心:[{"Name":"ack-node-problem-detector","Config":"{\"sls_project_name\":\"your_sls_project_name\"}"}]

更多信息,请参见Addons属性
ProxyModeStringkube-proxy代理模式。取值:
  • iptables(默认值)
  • ipvs
DisableRollbackBoolean失败时是否回滚。取值:
  • true(默认值):失败时不回滚。
  • false:失败时回滚。
    说明 如果选择失败时回滚,则会释放创建过程中所生产的资源,因此不推荐使用false。
SnatEntryBoolean是否为网络配置SNAT。取值:
  • true:配置。
  • false(默认值):不配置。
说明 如果使用自动创建的专有网络,则必须设置为true。如果使用已有非系统自动创建的专有网络,则需要根据是否具备出网能力来设置。
ZoneIdsListWorker节点所属的交换机可用区。
ResourceGroupIdString集群所属的资源组ID。
VSwitchIdsList交换机ID列表。列表可以包含1~3个交换机ID。

VpcId和VSwitchIds只能同时为空或者同时都设置对应的值。

LoginPasswordString登录密码。长度为8~30个字符。必须同时包含大写英文字母、小写英文字母,数字和特殊字符中至少三项,支持的特殊字符为:( ) ` ~ ! @ # $ % ^ & * - + = | { } [ ] : ; ‘ < > , . ? /

LoginPassword和KeyPair二者只能指定一个参数。

KeyPairString密钥对名称。LoginPassword和KeyPair二者只能指定一个参数。
EndpointPublicAccessBoolean是否开启公网API Server。取值:
  • true(默认值):开启公网API Server。
  • false:仅开启私网API Server。
WorkerSystemDiskSizeNumberWorker节点系统盘大小。默认值:120。

单位:GiB。

WorkerSystemDiskCategoryStringWorker节点系统盘类型。取值:
  • cloud_efficiency(默认值):高效云盘。
  • cloud_ssd:SSD云盘。
  • cloud_essd:ESSD云盘。
WorkerDataDiskBooleanWorker节点是否挂载数据盘。取值:
  • true:挂载。
  • false(默认值):不挂载。
WorkerDataDiskSizeIntegerWorker节点数据盘大小。
WorkerDataDiskCategoryString数据盘类型。取值:
  • cloud_efficiency(默认值):高效云盘。
  • cloud_ssd:SSD云盘。
  • cloud_essd:ESSD云盘。
TimeoutMinsNumber集群资源栈创建超时时间。默认值:60。

单位:分钟。

ClusterSpecString托管版集群类型。取值:
  • ack.pro.small:专业托管集群,即:ACK@Edge Pro版集群。
  • ack.standard(默认值):标准托管集群,即ACK@Edge标准版集群。
ContainerCidrStringPod网络地址段。当创建Flannel网络类型的集群时,ContainerCidr为必填。ContainerCidr必须是有效的私有网段,即以下网段及其子网:
  • 10.0.0.0/8
  • 172.16-31.0.0/12-16
  • 192.168.0.0/16
不能与专有网络及专有网络内已有Kubernetes集群使用的网段重复,且创建成功后不能修改。

关于集群网络规划,请参见Kubernetes集群网络规划

CloudMonitorFlagsBoolean是否安装云监控插件。取值:
  • true:安装。
  • false(默认值):不安装。
WorkerInstanceTypesListWorker节点实例规格。
IsEnterpriseSecurityGroupBoolean是否创建高级安全组。当SecurityGroupId为空时,该参数生效。取值:
  • true:创建。安装了Terway的集群,必须创建高级安全组。
  • false(默认值):不创建。
AutoRenewPeriodNumber自动续借周期。当ChargeType取值为PrePaid,且AutoRenew取值为true时,该参数有效。取值:
  • 当PeriodUnit取值为Week时:1、2、3。
  • 当PeriodUnit取值为Month时:1、2、3、6、12。

默认值:1。

ChargeTypeString付费类型。取值:
  • PrePaid:预付费。
  • PostPaid(默认值):按量付费。
AutoRenewBoolean是否自动续费。当ChargeType取值为PrePaid时该参数有效。取值:
  • true(默认值):自动续期。
  • false:不自动续期。
PeriodNumber购买资源的时长。当ChargeType为PrePaid时,该参数生效且为必选参数。取值:
  • 当PeriodUnit为Week时:1~4。
  • 当PeriodUnit为Month时:1~9、12、24、36、48、60。
默认值:1。
NodeCidrMaskString可分配给节点的最大CIDR地址块数量。数量由指定的pod CIDR决定。该参数仅在集群使用Flannel插件时生效。

默认值:25。

PeriodUnitString购买资源的时长周期。当ChargeType为PrePaid时该参数有效。取值:
  • Week:周。
  • Month(默认值):月。
DeletionProtectionBoolean是否启用删除保护功能。启用删除保护后,集群不能被直接删除。取值:
  • true:启用。
  • false(默认值):禁用。
WorkerDataDisksListWorker数据盘类型、大小等配置。只有在挂载Worker节点数据盘时有效。更多信息,请参见WorkerDataDisks属性

Tags语法

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

Tags属性

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

WorkerDataDisks语法

"WorkerDataDisks": [
  {
    "Category": String,
    "Size": Number
  }
]

WorkerDataDisks属性

属性名称 类型必须允许更新描述约束
CategoryStringWorker节点数据盘类型。取值:
  • cloud:普通云盘。
  • cloud_ssd:SSD云盘。
  • cloud_efficiency(默认值):高效云盘。
  • cloud_essd:ESSD云盘。
SizeNumber数据盘大小。取值范围:40~32,768。单位:GiB。

Addons语法

"Addons": [
  {
    "Disabled": Boolean,
    "Config": String,
    "Name": String
  }
]

Addons属性

属性名称类型必须允许更新描述约束
DisabledBoolean是否禁止默认安装组件。取值:
  • true:禁止默认安装组件。
  • false(默认值):允许默认安装组件。
ConfigString组件配置。
NameString组件名称。

返回值

Fn::GetAtt

  • ClusterId:集群ID。
  • TaskId:任务ID。系统自动分配,用于查询任务状态。
  • WorkerRamRoleName:Worker节点RAM角色名称。
  • DefaultUserKubeConfig:用户配置集群凭据的默认Kubernetes配置。
  • ScalingRuleId:伸缩规则ID。
  • ScalingGroupId:伸缩组ID。
  • PrivateUserKubConfig:用户配置集群凭据的专有Kubernetes配置。
  • ScalingConfigurationId:伸缩配置ID。
  • Nodes:集群节点列表。
  • APIServerSLBId:API服务器负载均衡ID。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Description: Test ManagedEdgeKubernetesCluster
    Parameters:
      VSwitchZoneId:
        Type: String
        AssociationProperty: ALIYUN::ECS::Instance::ZoneId
        Description: Availability ID for existing switches
        Label: VSwitch Zone ID
      VpcId:
        Type: String
        Default: Null
        AssociationProperty: ALIYUN::ECS::VPC::VPCId
        Description: Please search the ID starts with (vpc-xxx)from console-Virtual Private Cloud
        Label: Existing VPC ID
      VSwitchId:
        Type: String
        Default: Null
        AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
        Description: Please search the business VSwitch ID starts with(vsw-xxx)from console-Virtual Private Cloud-VSwitches
        Label: VSwitch ID
        AssociationPropertyMetadata:
          ZoneId: ${VSwitchZoneId}
          VpcId: ${VpcId}
      ClusterName:
        Type: String
        Default: mytest
      Password:
        Type: String
        Description: Server login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^*_-+=|{}[]:;,.? Special symbol in).
        MinLength: 8
        Label: Instance Password
        NoEcho: true
        MaxLength: 30
        ConstraintDescription: Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^*_-+=|{}[]:;',.?/ Special symbol in).
      NumOfNodes:
        Type: Number
        Default: 1
        MinValue: 0
        MaxValue: 300
      WorkerInstanceType:
        AssociationProperty: ALIYUN::ECS::Instance::InstanceType
        AssociationPropertyMetadata:
          ZoneId: VSwitchZoneId
        Type: String
        Label: Instance Type
      WorkerSystemDiskCategory:
        AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
        AssociationPropertyMetadata:
          ZoneId: ${VSwitchZoneId}
          InstanceType: ${WorkerInstanceType}
        Type: String
        Label: System Disk Type
    Resources:
      Cluster:
        Type: ALIYUN::CS::ManagedEdgeKubernetesCluster
        Properties:
          NumOfNodes:
            Ref: NumOfNodes
          Name:
            Ref: ClusterName
          LoginPassword:
            Ref: Password
          VpcId:
            Ref: VpcId
          VSwitchIds:
            - Ref: VSwitchId
          WorkerInstanceTypes:
            - Ref: WorkerInstanceType
          WorkerSystemDiskCategory:
            Ref: WorkerSystemDiskCategory
          ServiceCidr: 172.19.0.0/20
    Outputs:
      ClusterId:
        Value:
          Fn::GetAtt:
            - Cluster
            - ClusterId
      TaskId:
        Value:
          Fn::GetAtt:
            - Cluster
            - TaskId
    
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Description": "Test ManagedEdgeKubernetesCluster",
      "Parameters": {
        "VSwitchZoneId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
          "Description": "Availability ID for existing switches",
          "Label": "VSwitch Zone ID"
        },
        "VpcId": {
          "Type": "String",
          "Default": null,
          "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
          "Description": "Please search the ID starts with (vpc-xxx)from console-Virtual Private Cloud",
          "Label": "Existing VPC ID"
        },
        "VSwitchId": {
          "Type": "String",
          "Default": null,
          "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
          "Description": "Please search the business VSwitch ID starts with(vsw-xxx)from console-Virtual Private Cloud-VSwitches",
          "Label": "VSwitch ID",
          "AssociationPropertyMetadata": {
            "ZoneId": "${VSwitchZoneId}",
            "VpcId": "${VpcId}"
          }
        },
        "ClusterName": {
          "Type": "String",
          "Default": "mytest"
        },
        "Password": {
          "Type": "String",
          "Description": "Server login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^*_-+=|{}[]:;,.? Special symbol in).",
          "MinLength": 8,
          "Label": "Instance Password",
          "NoEcho": true,
          "MaxLength": 30,
          "ConstraintDescription": "Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^*_-+=|{}[]:;',.?/ Special symbol in)."
        },
        "NumOfNodes": {
          "Type": "Number",
          "Default": 1,
          "MinValue": 0,
          "MaxValue": 300
        },
        "WorkerInstanceType": {
          "AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
          "AssociationPropertyMetadata": {
            "ZoneId": "VSwitchZoneId"
          },
          "Type": "String",
          "Label": "Instance Type"
        },
        "WorkerSystemDiskCategory": {
          "AssociationProperty": "ALIYUN::ECS::Disk::SystemDiskCategory",
          "AssociationPropertyMetadata": {
            "ZoneId": "${VSwitchZoneId}",
            "InstanceType": "${WorkerInstanceType}"
          },
          "Type": "String",
          "Label": "System Disk Type"
        }
      },
      "Resources": {
        "Cluster": {
          "Type": "ALIYUN::CS::ManagedEdgeKubernetesCluster",
          "Properties": {
            "NumOfNodes": {
              "Ref": "NumOfNodes"
            },
            "Name": {
              "Ref": "ClusterName"
            },
            "LoginPassword": {
              "Ref": "Password"
            },
            "VpcId": {
              "Ref": "VpcId"
            },
            "VSwitchIds": [
              {
                "Ref": "VSwitchId"
              }
            ],
            "WorkerInstanceTypes": [
              {
                "Ref": "WorkerInstanceType"
              }
            ],
            "WorkerSystemDiskCategory": {
              "Ref": "WorkerSystemDiskCategory"
            },
            "ServiceCidr": "172.19.0.0/20"
          }
        }
      },
      "Outputs": {
        "ClusterId": {
          "Value": {
            "Fn::GetAtt": [
              "Cluster",
              "ClusterId"
            ]
          }
        },
        "TaskId": {
          "Value": {
            "Fn::GetAtt": [
              "Cluster",
              "TaskId"
            ]
          }
        }
      }
    }

更多示例,请参见:JSON示例YAML示例