Create an ACK Serverless cluster using OpenAPI

Updated at:

Call CreateCluster to create a new ACK Serverless cluster instance.

Request syntax

POST /clusters HTTP/1.1
Content-Type: application/json

{
  "cluster_type": "String",
  "profile": "String",
  "cluster_spec": "String",
  "name": "String",
  "kubernetes_version": "String",
  "private_zone": Boolean,
  "region_id": "String",
  "endpoint_public_access": Boolean,
  "service_discovery_types": ["String"],
  "zoneid": "String",
  "logging_type": "String",
  "tags": [
    {
      "key": "String",
      "value": "String"
    }
  ],
  "deletion_protection": Boolean,
  "service_cidr": "String",
  "timezone": "String",
  "addons": [
    {
      "name": "String",
      "config": "String",
      "disabled": Boolean
    }
  ],
  "snat_entry": Boolean,
  "vpcid": "String",
  "vswitch_ids": ["String"],
  "security_group_id": "String"
}

Request parameters

Parameter Type Required Example Description
cluster_type String Yes ManagedKubernetes The cluster type. Set to ManagedKubernetes with profile: Serverless to create an ACK Serverless cluster.
profile String Yes Serverless The cluster identifier. Set to Serverless with cluster_type: ManagedKubernetes to create an ACK Serverless cluster.
cluster_spec String No ack.pro.small The ACK Serverless cluster edition. Valid values: ack.pro.small (professional), ack.standard (standard). Default: ack.standard. See Cluster overview.
name String Yes cluster-demo The cluster name. 1–63 characters: digits, Chinese characters, letters, and hyphens (-). Cannot start with a hyphen.
kubernetes_version String No 1.32.1-aliyun.1 The Kubernetes version, aligned with a Kubernetes community baseline version. Select the latest version. If not specified, the latest version is used. The console supports only the two latest versions. Clusters of other Kubernetes versions can be created through the API. See supported Kubernetes versions.
private_zone Boolean No false Whether to enable Alibaba Cloud DNS PrivateZone for service discovery. Valid values: true (enabled), false (disabled).
region_id String Yes cn-beijing The cluster region.
endpoint_public_access Boolean No true Whether to expose the API server to the Internet. Valid values: true (Internet-accessible), false (accessible only within the Virtual Private Cloud (VPC)). Default: true.
service_discovery_types Array of String No PrivateZone The service discovery method. Valid values: CoreDNS (Kubernetes-native DNS; deploys two Elastic Container Instances (ECI) with 0.25 CPU cores and 512 MiB memory each for DNS resolution), PrivateZone (Alibaba Cloud DNS PrivateZone; activate before use). Default: not set.
zoneid String No cn-beiji**** The zone ID.
Important

Required when neither vpcid nor vswitch_ids is specified.

logging_type String No SLS Whether to enable Simple Log Service (SLS). Set to SLS to enable. Applies only to ACK Serverless clusters.
tags Array of tag No [{"key": "env", "value": "prod"}] Tags for the cluster. Each tag has a key and a value.
deletion_protection Boolean No true Whether to enable deletion protection. When enabled, the cluster cannot be deleted from the console or through the API. Valid values: true (enabled), false (disabled). Default: false.
service_cidr String No 172.21.0.0/20 The Service CIDR (Classless Inter-Domain Routing) block. Valid ranges: 10.0.0.0/16–24, 172.16–31.0.0/16–24, 192.168.0.0/16–24. Must not overlap with the VPC CIDR block 10.1.0.0/21 or any existing cluster CIDR blocks in the VPC. Cannot be changed after cluster creation. Default: 172.19.0.0/20.
timezone String No Asia/Shanghai The cluster time zone. See Supported time zones.
addons Array of addon No [{"name":"logtail-ds","config":"{\"sls_project_name\":\"your_sls_project_name\"}"}] Addons to install. Each entry has three fields: name (required), config (optional; leave blank if unneeded), disabled (optional; true to skip installation). See Addon configuration.
snat_entry Boolean No true Whether to create a NAT gateway and SNAT rules. Valid values: true (creates NAT gateway and SNAT rules for VPC Internet access), false (no NAT gateway or SNAT rules, so the cluster VPC has no Internet access). Default: false.
vpcid String No vpc-2zeik9h3ahvv2zz95**** The VPC ID. The cluster must run in a VPC. Set vpcid and vswitch_ids together, or leave both unset.
vswitch_ids Array of String No ["vsw-2ze97jwri7cei0mpw****"] The vSwitch IDs. Specify 1–3 vSwitches.
security_group_id String No sg-bp1bdue0qc1g7k**** The security group ID. Nodes are automatically added to this security group. Specify either this or is_enterprise_security_group.
resource_group_id String No rg-acfm3mkrure**** The resource group ID for cluster isolation.

Addon configuration

Log Service addon (logtail-ds): Optional. Without SLS, cluster auditing is unavailable.

  • To use an existing SLS project:

    [{"name": "logtail-ds", "config": "{\"IngressDashboardEnabled\":\"true\",\"sls_project_name\":\"your_sls_project_name\"}"}]
  • To create a new SLS project:

    [{"name": "logtail-ds", "config": "{\"IngressDashboardEnabled\":\"true\"}"}]

Ingress controller (nginx-ingress-controller): Optional. Installed by default in ACK dedicated clusters.

  • To install with Internet access enabled:

    [{"name": "nginx-ingress-controller", "config": "{\"IngressSlbNetworkType\":\"internet\"}"}]
  • To skip installation:

    [{"name": "nginx-ingress-controller", "config": "", "disabled": true}]

Response elements

HTTP/1.1 200
Content-Type: application/json

{
  "cluster_id": "String",
  "request_id": "String",
  "task_id": "String"
}
Parameter Type Example Description
cluster_id String cb95aa626a47740afbf6aa099b650**** The cluster ID.
request_id String 687C5BAA-D103-4993-884B-C35E4314A1E1 The request ID.
task_id String T-5a54309c80282e39ea00002f The task ID.

Examples

Example 1: Create a cluster with an auto-created VPC

Creates a standard ACK Serverless cluster in cn-hangzhou with an auto-created VPC, a NAT gateway, and SLS.

Request:

POST /clusters HTTP/1.1
<Common request headers>
{
    "cluster_type": "ManagedKubernetes",
    "profile": "Serverless",
    "cluster_spec": "ack.standard",
    "name": "test-ask",
    "region_id": "cn-hangzhou",
    "endpoint_public_access": false,
    "logging_type": "SLS",
    "private_zone": false,
    "snat_entry": true,
    "tags": [
        {
            "key": "k-aa",
            "value": "v-aa"
        }
    ],
    "deletion_protection": false,
    "addons": [
        {
            "name": "logtail-ds"
        }
    ],
    "zoneid": "cn-hangzhou-i"
}

Response:

{
    "cluster_id": "cb95aa626a47740afbf6aa099b650****",
    "request_id": "687C5BAA-D103-4993-884B-C35E4314A1E1",
    "task_id": "T-5a54309c80282e39ea00002f"
}

Example 2: Create a cluster in an existing VPC

Creates a professional ACK Serverless cluster in an existing VPC in cn-shenzhen with an Internet-accessible API server, deletion protection, and PrivateZone service discovery.

Request:

POST /clusters HTTP/1.1
<Common request headers>
{
    "cluster_type": "ManagedKubernetes",
    "profile": "Serverless",
    "cluster_spec": "ack.pro.small",
    "name": "ask-cluster",
    "region_id": "cn-shenzhen",
    "endpoint_public_access": true,
    "logging_type": "SLS",
    "private_zone": true,
    "tags": [
        {
            "key": "tier",
            "value": "frontend"
        }
    ],
    "deletion_protection": true,
    "addons": [
        {
            "name": "logtail-ds"
        }
    ],
    "vpcid": "vpc-wz984yvbd6lck22z3****",
    "vswitch_ids": [
        "vsw-wz9uwxhawmtzg7u9h****"
    ],
    "security_group_id": "sg-wz9b86l4s7nthi1k****"
}

Response:

{
    "cluster_id": "cb95aa626a47740afbf6aa099b650****",
    "request_id": "687C5BAA-D103-4993-884B-C35E4314A1E1",
    "task_id": "T-5a54309c80282e39ea00002f"
}

Error codes

See the Error Center.

Developer resources

  • SDK

    Alibaba Cloud provides SDKs in multiple languages to simplify API calls and eliminate manual request signing.

  • OpenAPI Explorer

    Retrieve APIs, debug online, and generate SDK code examples.

  • Alibaba Cloud CLI

    Manage Alibaba Cloud resources across products and services from the command line.