All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::CS::ASKCluster

Last Updated:Aug 30, 2023

ALIYUN::CS::ASKCluster is used to create a Serverless Kubernetes (ASK) cluster.

Syntax

{
  "Type": "ALIYUN::CS::ASKCluster",
  "Properties": {
    "KubernetesVersion": String,
    "EndpointPublicAccess": Boolean,
    "ZoneId": String,
    "ResourceGroupId": String,
    "VSwitchIds": List,
    "SecurityGroupId": String,
    "Addons": List,
    "DeletionProtection": Boolean,
    "ClusterSpec": String,
    "Name": String,
    "TimeZone": String,
    "ServiceDiscoveryTypes": List,
    "VpcId": String,
    "ServiceCidr": String,
    "SnatEntry": Boolean,
    "Tags": List,
    "PrivateZone": Boolean
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

KubernetesVersion

String

No

No

The cluster version.

None

EndpointPublicAccess

Boolean

No

No

Specifies whether to allow the cluster to access the API server over the Internet.

Valid values:

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

  • false: disables access to the API server over the Internet.

ZoneId

String

No

No

The ID of the zone in which the cluster is deployed.

When you create an ACK Serverless cluster, you must configure ZoneId if VpcId and VSwitchIds are not configured. This way, the system automatically creates a virtual private cloud (VPC) in the specified zone.

ResourceGroupId

String

No

Yes

The ID of the resource group to which the cluster belongs.

None

VSwitchIds

List

No

No

The IDs of the vSwitches that are specified for the nodes in the cluster.

You can specify up to three vSwitches.

Note

This parameter is required when you create a managed Kubernetes cluster that does not contain nodes.

SecurityGroupId

String

No

No

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

None

Addons

List

No

No

The cluster components.

None

DeletionProtection

Boolean

No

No

Specifies whether deletion protection is enabled for the cluster. If this feature is enabled, the cluster cannot be deleted by using the console or calling API operations.

Valid values:

  • true: enables deletion protection for the cluster. If you select this value, you cannot delete the cluster by using the console or by calling API operations.

  • false (default): disables deletion protection for the cluster. If you select this value, you can delete the cluster by using the console or by calling API operations.

ClusterSpec

String

No

No

The type of ACK managed cluster.

Valid values:

  • ack.pro.small: ACK Pro cluster

  • ack.standard (default): ACK standard cluster

Note

If you leave this property empty, an ACK standard cluster is created.

For more information, see Overview of ACK Pro clusters.

Name

String

Yes

No

The cluster name.

The name must be 1 to 63 characters in length and can contain digits, letters, and hyphens (-). The name cannot start with a hyphen (-).

TimeZone

String

No

No

The time zone of the cluster.

None

ServiceDiscoveryTypes

List

No

No

The type of service discovery that is implemented in the ACK Serverless cluster.

Valid values:

  • CoreDNS: a standard service discovery plug-in provided by open source Kubernetes. To use the Domain Name System (DNS) resolution, you must provision pods. By default, two elastic container instances are used. The specification of each instance is 0.25 CPU cores and 512 MiB of memory.

  • PrivateZone: a DNS resolution service provided by Alibaba Cloud. Before you use it for service discovery, you must activate Alibaba Cloud DNS PrivateZone.

VpcId

String

No

No

The VPC that is used by the cluster.

None

ServiceCidr

String

No

No

The CIDR block of Services.

Valid values: 10.0.0.0/16-24, 172.16-31.0.0/16-24, and 192.168.0.0/16-24. The specified CIDR block cannot overlap with that of the VPC (10.1.0.0/21) or those of the ACK clusters that are deployed in the VPC. You cannot change the CIDR block after you create the cluster.

Note

By default, the CIDR block of Services is set to 172.19.0.0/20.

SnatEntry

Boolean

No

No

Specifies whether to configure Source Network Address Translation (SNAT) rules for the VPC in which your cluster is deployed.

Valid values:

  • true (default): automatically creates a Network Address Translation (NAT) gateway and configures SNAT rules. Set this property to true if nodes and applications in the cluster need to access the Internet.

  • false: does not create a NAT gateway or configure SNAT rules. In this case, nodes and applications in the cluster cannot access the Internet.

Note

If this feature is disabled when you create the cluster, you can manually enable this feature after you create the cluster. For more information, see Enable an existing ACK cluster to access the Internet.

Tags

List

No

Yes

The tags that you want to add to nodes.

You must add tags based on the following rules:

  • Each tag is a case-sensitive key-value pair. You can add up to 20 tags.

  • A key must be unique and can be up to 64 characters in length. A value can be an empty string or up to 128 characters in length. Keys and values cannot start with aliyun, acs:, https://, or http://. For more information, see Labels and selectors.

PrivateZone

Boolean

No

No

Specifies whether to enable Alibaba Cloud DNS PrivateZone.

Valid values:

  • true

  • false

Addons syntax

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

Addons properties

Property

Type

Required

Editable

Description

Constraint

Config

String

No

No

The component configurations.

None

Disabled

Boolean

No

No

Specifies whether to disable automatic installation of the component.

In addition to the required components, some optional components, such as Log Service components, are also installed when you create a cluster. You can configure this property to disable the automatic installation of an optional component. You can install the component in the console or by calling API operations after the cluster is created.

Valid values:

  • true: disables automatic installation.

  • false: enables automatic installation.

Name

String

Yes

No

The component name.

None

Tags syntax

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

Tags properties

Property

Type

Required

Editable

Description

Constraint

Value

String

No

No

The label key.

None

Key

String

Yes

No

The label value.

None

Return values

Fn::GetAtt

  • TaskId: the ID of the task in which the cluster is created.

  • ClusterId: the ID of the cluster.

  • APIServerSLBId: the ID of the SLB instance that is associated with the API server.

  • ScalingGroupId: the ID of the scaling group.

  • ScalingRuleId: the ID of the scaling rule.

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

  • WorkerRamRoleName: the name of the RAM role assigned to worker nodes.

  • ScalingConfigurationId: the ID of the scaling configuration.

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

  • Nodes: the nodes in the cluster.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Description: Test Create ASKCluster
Parameters: {}
Resources:
  VSwitch:
    Type: ALIYUN::ECS::VSwitch
    Properties:
      VSwitchName: mytest
      VpcId:
        Ref: Vpc
      CidrBlock: 192.168.1.0/24
      ZoneId:
        Fn::Select:
          - '0'
          - Fn::GetAZs:
              Ref: ALIYUN::Region
  Vpc:
    Type: ALIYUN::ECS::VPC
    Properties:
      VpcName: mytest
      CidrBlock: 192.168.0.0/16
  ASKCluster:
    Type: ALIYUN::CS::ASKCluster
    Properties:
      VpcId:
        Ref: Vpc
      ClusterSpec: ack.pro.small
      Name: mytest
      VSwitchIds:
        - Ref: VSwitch
Outputs:
  ClusterId:
    Value:
      Fn::GetAtt:
        - ASKCluster
        - ClusterId
  TaskId:
    Value:
      Fn::GetAtt:
        - ASKCluster
        - TaskId

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": "Test Create ASKCluster",
  "Parameters": {},
  "Resources": {
    "VSwitch": {
      "Type": "ALIYUN::ECS::VSwitch",
      "Properties": {
        "VSwitchName": "mytest",
        "VpcId": {
          "Ref": "Vpc"
        },
        "CidrBlock": "192.168.1.0/24",
        "ZoneId": {
          "Fn::Select": [
            "0",
            {
              "Fn::GetAZs": {
                "Ref": "ALIYUN::Region"
              }
            }
          ]
        }
      }
    },
    "Vpc": {
      "Type": "ALIYUN::ECS::VPC",
      "Properties": {
        "VpcName": "mytest",
        "CidrBlock": "192.168.0.0/16"
      }
    },
    "ASKCluster": {
      "Type": "ALIYUN::CS::ASKCluster",
      "Properties": {
        "VpcId": {
          "Ref": "Vpc"
        },
        "ClusterSpec": "ack.pro.small",
        "Name": "mytest",
        "VSwitchIds": [
          {
            "Ref": "VSwitch"
          }
        ]
      }
    }
  },
  "Outputs": {
    "ClusterId": {
      "Value": {
        "Fn::GetAtt": [
          "ASKCluster",
          "ClusterId"
        ]
      }
    },
    "TaskId": {
      "Value": {
        "Fn::GetAtt": [
          "ASKCluster",
          "TaskId"
        ]
      }
    }
  }
}