Creates a Container Service for Kubernetes (ACK) Serverless cluster.
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. Combined with profile: Serverless, this creates an ACK Serverless cluster. |
profile |
String | Yes | Serverless |
The cluster identifier. Set to Serverless. Combined with cluster_type: ManagedKubernetes, this creates an ACK Serverless cluster. |
cluster_spec |
String | No | ack.pro.small |
The edition of the ACK Serverless cluster. Valid values: ack.pro.small (professional ACK Serverless cluster), ack.standard (standard ACK Serverless cluster). Default: ack.standard. For more information, see Cluster overview. |
name |
String | Yes | cluster-demo |
The cluster name. Must be 1–63 characters and can contain digits, letters, and hyphens (-). Cannot start with a hyphen. |
kubernetes_version |
String | No | 1.32.1-aliyun.1 |
The Kubernetes version. If not specified, the latest stable version is used. To create clusters running earlier versions, use this parameter. For supported versions, see Overview of Kubernetes versions supported by ACK. |
private_zone |
Boolean | No | false |
Specifies whether to enable Alibaba Cloud DNS PrivateZone for service discovery. Valid values: true (enabled), false (disabled). For more information, see Enable service discovery based on Alibaba Cloud DNS PrivateZone. |
region_id |
String | Yes | cn-beijing |
The region where the cluster resides. |
endpoint_public_access |
Boolean | No | true |
Specifies whether to expose the API server over the Internet. Valid values: true (exposed over the Internet), false (accessible only within the virtual private cloud (VPC)). Default: true. |
service_discovery_types |
Array of String | No | PrivateZone |
The service discovery method for the cluster. Valid values: CoreDNS (Kubernetes-native DNS, deploys two elastic container instances (ECIs) with 0.25 CPU cores and 512 MiB of memory each), PrivateZone (Alibaba Cloud DNS PrivateZone; must be activated before use). Default: not set. |
zoneid |
String | No | cn-beiji**** |
The zone ID. Important
Required when neither |
logging_type |
String | No | SLS |
Specifies whether to enable Simple Log Service (SLS). Set to SLS to enable. Applies to ACK Serverless clusters only. |
tags |
Array of tag | No | [{"key": "env", "value": "prod"}] |
The tags to attach to the cluster. Each tag contains a key and a value. |
deletion_protection |
Boolean | No | true |
Specifies whether to enable deletion protection. When enabled, the cluster cannot be deleted from the ACK console or via API. Valid values: true (enabled), false (disabled). Default: false. |
service_cidr |
String | No | 172.21.0.0/20 |
The Service CIDR 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 or any existing cluster CIDR blocks in the VPC. Cannot be changed after the cluster is created. Default: 172.19.0.0/20. |
timezone |
String | No | Asia/Shanghai |
The cluster time zone. For supported values, see Supported time zones. |
addons |
Array of addon | No | [{"name":"logtail-ds","config":"{\"sls_project_name\":\"your_sls_project_name\"}"}] |
The addons to install. Each addon entry supports three fields: name (required), config (optional; leave blank if no configuration is needed), disabled (optional; set to true to skip automatic installation). See Addon configuration for details. |
snat_entry |
Boolean | No | true |
Specifies whether to create a NAT gateway and configure Source Network Address Translation (SNAT) rules. Valid values: true (creates a NAT gateway and SNAT rules, enabling Internet access from the VPC), false (no NAT gateway or SNAT rules created). Default: false. |
vpcid |
String | No | vpc-2zeik9h3ahvv2zz95**** |
The ID of the VPC where the cluster is deployed. If specified, vswitch_ids must also be specified. |
vswitch_ids |
Array of String | No | ["vsw-2ze97jwri7cei0mpw****"] |
The vSwitch IDs. Specify 1–3 vSwitches. |
security_group_id |
String | No | sg-bp1bdue0qc1g7k**** |
The ID of the security group to use. Nodes are automatically added to this group. Must specify either this parameter or is_enterprise_security_group. |
resource_group_id |
String | No | rg-acfm3mkrure**** |
The resource group ID. Use this to isolate clusters across different resource groups. |
Addon configuration
Log Service addon (`logtail-ds`): Optional. Without Simple Log Service enabled, the cluster auditing feature 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
This example creates a standard ACK Serverless cluster in cn-hangzhou. The VPC and NAT gateway are created automatically. Simple Log Service is enabled.
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****",
"RequestId": "687C5BAA-D103-4993-884B-C35E4314A1E1",
"task_id": "T-5a54309c80282e39ea00002f"
}
Example 2: Create a cluster in an existing VPC
This example creates a professional ACK Serverless cluster in an existing VPC in cn-shenzhen. The API server is accessible over the Internet, deletion protection is enabled, and Alibaba Cloud DNS PrivateZone is used for 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****",
"RequestId": "687C5BAA-D103-4993-884B-C35E4314A1E1",
"task_id": "T-5a54309c80282e39ea00002f"
}
Error codes
For more information about error codes, see the Error Center.