All Products
Search
Document Center

:ALIYUN::CS::ServerlessKubernetesCluster

Last Updated:Aug 30, 2023

ALIYUN::CS::ServerlessKubernetesCluster is used to create an ACK Serverless cluster.

Syntax

{
  "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,
    "ResourceGroupId": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

VpcId

String

No

No

The ID of the virtual private cloud (VPC).

If you do not specify this property, the system creates a VPC whose CIDR block is 192.168.0.0/16.

You must specify the VpcId and VSwitchId properties or leave both properties empty.

Name

String

Yes

No

The name of the cluster.

The name must start with a digit or letter. The name can contain letters, digits, and hyphens (-).

Tags

List

No

Yes

The tags of the cluster.

For more information, see Tags properties.

ZoneId

String

No

No

The ID of the zone.

None.

PrivateZone

Boolean

No

No

Specifies whether to activate Alibaba Cloud DNS PrivateZone to support the service discovery feature.

Default value: false. Valid values:

  • true

  • false

For more information, see Use Alibaba Cloud DNS PrivateZone to implement service discovery in ACK Serverless clusters.

VSwitchId

String

No

No

The ID of the vSwitch.

If you do not specify this property, the system creates a vSwitch whose CIDR block is 192.168.0.0/16.

You must specify the VpcId and VSwitchId properties or leave both properties empty.

EndpointPublicAccess

Boolean

No

No

Specifies whether to enable access to the API server over the Internet.

Default value: true. Valid values:

  • true: enables access to the API server over the Internet.

  • false: enables access to the API server only over the VPC.

SecurityGroupId

String

No

No

The ID of the security group to which the Elastic Compute Service (ECS) instances in the cluster belong.

None.

VSwitchIds

List

No

No

The list of vSwitch IDs.

The list can contain up to 10 vSwitch IDs.

If you do not specify this property, the system creates a vSwitch whose CIDR block is 192.168.0.0/16.

You must specify the VpcId and VSwitchId properties or leave both properties empty.

ServiceCidr

String

No

No

The CIDR block of the Container Service for Kubernetes (ACK) service.

The CIDR block of the service cannot overlap with the CIDR block of the VPC or container.

If you use the VPC that is created by the system, the CIDR block 172.19.0.0/20 is used by default.

Addons

List

No

No

The list of components that you want to install in the cluster.

Valid values:

  • For network component types, you can use Flannel or Terway when you create the cluster.

    • If you use the Flannel component, specify the value in the [{"Name":"flannel","Config":""}] format.

    • If you use the Terway component, specify the value in the [{"Name": "terway-eniip","Config": ""}] format.

  • For storage component types, you can use Container Storage Interface (CSI) or FlexVolume.

    • If you use the CSI component, specify the value in the [{"Name":"csi-plugin","Config": ""},{"Name": "csi-provisioner","Config": ""}] format.

    • If you use the FlexVolume component, specify the value in the [{"Name": "flexvolume","Config": ""}] format.

  • (Optional) For Log Service component types, you can use an existing Log Service project or create a project.

    Note

    If you do not activate Log Service, you cannot use the cluster auditing feature.

    • If you use an existing project, specify the value in the [{"Name": "logtail-ds","Config": "{\"IngressDashboardEnabled\":\"true\",\"sls_project_name\":\"your_sls_project_name\"}"}] format.

    • If you create a project, specify the value in the [{"Name": "logtail-ds","Config": "{\"IngressDashboardEnabled\":\"true\"}"}] format.

  • (Optional) For Ingress component types, nginx-ingress-controller is automatically installed in ACK dedicated clusters.

    • If you install nginx-ingress-controller and enable Internet access, specify the value in the [{"Name":"nginx-ingress-controller","Config":"{\"IngressSlbNetworkType\":\"internet\"}"}] format.

    • If you do not install nginx-ingress-controller, specify the value in the [{"Name": "nginx-ingress-controller","Config": "","Disabled": true}] format.

  • (Optional) For event center component types, the event center feature is automatically enabled for the cluster.

    You can use Kubernetes event centers to store and query events, and configure alerts. You can use the Logstores that are associated with Kubernetes event centers for free within 90 days. For more information, see Create and use an event center.

    If you enable the event center feature, specify the value in the [{"Name":"ack-node-problem-detector","Config":"{\"sls_project_name\":\"your_sls_project_name\"}"}] format.

For more information, see Addons properties.

KubernetesVersion

String

No

No

The Kubernetes version of the cluster.

Valid values:

  • 1.14.8-aliyun.1 if you use a cluster of Kubernetes 1.14.8

  • 1.16.9-aliyun.1 if you use a cluster of Kubernetes 1.16.9

ResourceGroupId

String

No

Yes

The resource group to which the cluster belongs.

None.

NatGateway

Boolean

No

No

Specifies whether to create a NAT gateway.

Default value: false. Valid values:

  • true

  • false

Tags syntax

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

Tags properties

Property

Type

Required

Editable

Description

Constraint

Key

String

Yes

No

The key of the tag.

The tag key must be 1 to 64 characters in length. The tag key cannot start with aliyun, acs:, https://, or http://.

Value

String

No

No

The value of the tag.

The tag value can be up to 128 characters in length. The tag value cannot start with aliyun, acs:, https://, or http://.

Addons syntax

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

Addons properties

Property

Type

Required

Editable

Description

Constraint

Disabled

Boolean

No

No

Specifies whether to disable automatic installation for the component.

Default value: false. Valid values:

  • true

  • false

Config

String

No

No

The configurations of the component.

None.

Name

String

Yes

No

The name of the component.

None.

Return values

Fn::GetAtt

  • ClusterId: the ID of the cluster.

  • TaskId: the ID of the task. The task ID is assigned by the system and is used to query the status of the task.

  • WorkerRamRoleName: the name of the RAM role for worker nodes.

  • DefaultUserKubeConfig: the default configurations of user credentials for the cluster.

  • ScalingRuleId: the ID of the scaling rule.

  • ScalingGroupId: the ID of the scaling group.

  • PrivateUserKubConfig: the private configurations of user credentials for the cluster.

  • ScalingConfigurationId: the ID of the scaling configuration.

  • Nodes: the list of nodes in the cluster.

  • APIServerSLBId: the ID of the Server Load Balancer (SLB) instance that is associated with the API server.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Description: Test ServerlessKubernetesCluster
    Parameters:
      VpcId:
        Type: String
        AssociationProperty: ALIYUN::ECS::VPC::VPCId
      ZoneId:
        Type: String
        AssociationProperty: ALIYUN::ECS::ZoneId
      VSwitchId:
        Type: Json
        AssociationProperty: List[Parameter]
        AssociationPropertyMetadata:
          Parameter:
            Type: String
            AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
            MinLength: 1
            MaxLength: 3
      SecurityGroupId:
        Type: String
        AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
        AssociationPropertyMetadata:
          VpcId: ${VpcId}
    Resources:
      Cluster:
        Type: ALIYUN::CS::ServerlessKubernetesCluster
        Properties:
          Name: serverless-kube-test
          PrivateZone: true
          ZoneId:
            Ref: ZoneId
          NatGateway: false
          VpcId:
            Ref: VpcId
          VSwitchIds:
            - Ref: VSwitchId
          KubernetesVersion: 1.18.8-aliyun.1
          EndpointPublicAccess: true
          Addons:
            - Name: nginx-ingress-controller
              Config: '{"IngressSlbNetworkType":"intranet"}'
            - Name: logtail-ds
              Config: '{"sls_project_name":"test"}'
            - Name: knative
          ServiceCidr: 172.25.0.0/20
          SecurityGroupId:
            Ref: SecurityGroupId
    Outputs:
      ClusterId:
        Value:
          Fn::GetAtt:
            - Cluster
            - ClusterId
      TaskId:
        Value:
          Fn::GetAtt:
            - Cluster
            - TaskId
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Description": "Test ServerlessKubernetesCluster",
      "Parameters": {
        "VpcId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
        },
        "ZoneId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::ZoneId"
        },
        "VSwitchId": {
          "Type": "Json",
          "AssociationProperty": "List[Parameter]",
          "AssociationPropertyMetadata": {
            "Parameter": {
              "Type": "String",
              "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
              "MinLength": 1,
              "MaxLength": 3
            }
          }
        },
        "SecurityGroupId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
          "AssociationPropertyMetadata": {
            "VpcId": "${VpcId}"
          }
        }
      },
      "Resources": {
        "Cluster": {
          "Type": "ALIYUN::CS::ServerlessKubernetesCluster",
          "Properties": {
            "Name": "serverless-kube-test",
            "PrivateZone": true,
            "ZoneId": {
              "Ref": "ZoneId"
            },
            "NatGateway": false,
            "VpcId": {
              "Ref": "VpcId"
            },
            "VSwitchIds": [
              {
                "Ref": "VSwitchId"
              }
            ],
            "KubernetesVersion": "1.18.8-aliyun.1",
            "EndpointPublicAccess": true,
            "Addons": [
              {
                "Name": "nginx-ingress-controller",
                "Config": "{\"IngressSlbNetworkType\":\"intranet\"}"
              },
              {
                "Name": "logtail-ds",
                "Config": "{\"sls_project_name\":\"test\"}"
              },
              {
                "Name": "knative"
              }
            ],
            "ServiceCidr": "172.25.0.0/20",
            "SecurityGroupId": {
              "Ref": "SecurityGroupId"
            }
          }
        }
      },
      "Outputs": {
        "ClusterId": {
          "Value": {
            "Fn::GetAtt": [
              "Cluster",
              "ClusterId"
            ]
          }
        },
        "TaskId": {
          "Value": {
            "Fn::GetAtt": [
              "Cluster",
              "TaskId"
            ]
          }
        }
      }
    }

For more examples, visit ServerlessKubernetesCluster.json and ServerlessKubernetesCluster.yml.