You can call CreateCluster to create a Container Service for Kubernetes (ACK) cluster that supports sandboxed containers.
Request information
Request line
POST /clusters HTTP/1.1
Operation-specific request parameters
No operation-specific request parameters are used. For more information, see Common parameters.
Request body
{
"name":"The name of the cluster.",
"cluster_type":"The type of the cluster. Set the value to ManagedKubernetes.",
"disable_rollback": "true",
"timeout_mins": "60",
"region_id":"The ID of the region.",
"snat_entry":"Specifies whether to configure Source Network Address Translation (SNAT).",
"cloud_monitor_flags":"Specifies whether to install the Cloud Monitor agent.",
"public_slb":"Specifies whether to enable access to the endpoint of the cluster over the Internet.",
"worker_instance_type":"The Elastic Compute Service (ECS) instance type of worker nodes.",
"num_of_nodes":"The number of worker nodes.",
"vpcid": "vpc id",
"vswitch_ids":"The VSwitch IDs of worker nodes.",
"service_cidr":"The CIDR block of services.",
"login_password":"The SSH logon password. You must set login_password or key_pair.",
"key_pair":"The name of the key pair. You must set key_pair or login_password.",
"worker_system_disk_category":"The system disk type of worker nodes.",
"worker_system_disk_size":"The system disk size of a worker node.",
"worker_data_disk_category":"The data disk type of worker nodes.",
"worker_data_disk_size":"The size of a data disk that a worker node uses.",
"worker_data_disk":"Specifies whether to mount data disks to worker nodes. Valid values: true and false.",
"worker_instance_charge_type":"The billing method of worker nodes. Valid values: PrePaid and PostPaid.",
"worker_period_unit":"The unit of the subscription duration of worker nodes. Valid values: Week and Month. This parameter takes effect only if worker_instance_charge_type is set to PrePaid.",
"worker_period":"The subscription duration of worker nodes. This parameter takes effect only if worker_instance_charge_type is set to PrePaid.",
"worker_auto_renew":"Specifies whether to enable auto renewal for worker nodes. Valid values: true and false.",
"worker_auto_renew_period":"The auto renewal period for worker nodes.",
"kubernetes_version":"The version of the cluster.",
"addons": [{"name":"terway-eniip"}],
"runtime": {"name": "Sandboxed-Container.runv", "version":"1.0.0"},
"pod_vswitch_ids":"The VSwitch IDs of pods. We recommend that you specify three VSwitches in different zones to ensure high availability."
}
Parameter | Type | Required | Description |
---|---|---|---|
addons | list | Yes | The add-ons to be installed for the cluster.
|
cluster_type | string | Yes | The type of the cluster.
Set the value to ManagedKubernetes. |
key_pair | string | Yes | The name of the key pair. You must set key_pair or login_password. |
kubernetes_version | string | Yes | The version of the cluster. Set the value to 1.14.6-aliyun.1 or later.
|
login_password | string | Yes | The SSH logon password. The password must be 8 to 30 characters in length and contain a minimum of three of the following character types: uppercase letters, lowercase letters, digits, and special characters. You must set login_password or key_pair. |
name | string | Yes | The name of the cluster. The name can contain uppercase letters, lowercase letters, digits, and hyphens (-). |
num_of_nodes | int | Yes | The number of worker nodes. Valid values: 0 to 100. |
pod_vswitch_ids | list | Yes | The VSwitch IDs of pods. This parameter is required only when you specify terway-eniip as the network add-on. |
region_id | string | Yes | The ID of the region where the cluster is deployed. |
runtime | json | Yes |
|
snat_entry | bool | Yes | Specifies whether to configure SNAT.
|
vpcid | string | Yes | The ID of the VPC. If you do not set this parameter, the system automatically creates
a VPC that uses the CIDR block 192.168.0.0/16.
Note You must specify both vpcid and vswitch_ids or leave both parameters empty.
|
vswitch_ids | list | Yes | The IDs of VSwitches. Specify one to three VSwitch IDs. |
worker_data_disk | bool | Yes | Specifies whether to mount data disks to worker nodes. Set the value to true. |
worker_data_disk_size | string | Yes | The size of a data disk. Unit: GiB. Set the value to 200 or larger. |
worker_instance_type | string | Yes | The ECS instance type of worker nodes that support sandboxed containers. Valid values:
|
worker_system_disk_category | string | Yes | The system disk type of worker nodes. |
worker_system_disk_size | int | Yes | The system disk size of a worker node. Unit: GiB. |
cloud_monitor_flags | bool | No | Specifies whether to install the Cloud Monitor agent. Valid values:
|
disable_rollback | bool | No | Specifies whether to retain all resources if the operation fails. Valid values:
|
endpoint_public_access | bool | No | Specifies whether to enable access to the API server over the Internet. Valid values:
|
service_cidr | string | No | The CIDR block of services. This CIDR block cannot overlap with the CIDR block of the VPC or pods. If the VPC is automatically created by the system, the CIDR block of services is set to 172.19.0.0/20. |
addons | Array | No |
The add-ons to be installed for the cluster.
|
tags | list | No | The tags of the cluster.
|
timeout_mins | int | No | The time-out period in minutes during which a cluster creation operation must be completed. Default value: 60. |
worker_auto_renew | bool | No | Specifies whether to enable auto renewal for worker nodes. Valid values:
|
worker_auto_renew_period | int | No | The auto renewal period for worker nodes. This parameter takes effect only if worker_instance_charge_type
is set to PrePaid and worker_auto_renew is set to true.
|
worker_data_disk_category | string | No | The type of data disks. This parameter takes effect only if worker_data_disk is set
to true. Valid values:
|
worker_instance_charge_type | string | No | The billing method of worker nodes. Valid values:
|
worker_period | int | No | The subscription duration of worker nodes. This parameter takes effect only if worker_instance_charge_type is set to PrePaid.
|
worker_period_unit | string | No | The unit of the subscription duration. This parameter is required if worker_instance_charge_type
is set to PrePaid. Valid values:
|
Response information
Response line
HTTP/1.1 202 Accepted
Operation-specific response parameters
No operation-specific response parameters are used. For more information, see Common parameters.
Parameter | Type | Description |
---|---|---|
cluster_id | string | The ID of the cluster. |
request_id | string | The ID of the request. |
task_id | string | The ID of the task. The task ID is automatically assigned by the system. You can use the task ID to query the task status. |
Examples
Sample requests
POST /clusters HTTP/1.1
<Common request parameters>
{
"name": "test-sandbox",
"cluster_type": "ManagedKubernetes",
"disable_rollback": true,
"timeout_mins": 60,
"region_id": "cn-hangzhou",
"snat_entry": true,
"cloud_monitor_flags": false,
"endpoint_public_access": true,
"worker_instance_type": "ecs.ebmg5s.24xlarge",
"num_of_nodes": 2,
"vpcid": "vpc-bp1iybm49v9jgb50xxxxx",
"vswitch_ids": ["vsw-bp1ue9z93i9zpcblxxxxx"],
"service_cidr": "192.168.0.0/16",
"login_password": "xxxxxxxx",
"worker_system_disk_category": "cloud_efficiency",
"worker_system_disk_size": 200,
"worker_data_disk_category": "cloud_efficiency",
"worker_data_disk_size": 200,
"worker_data_disk": true,
"worker_instance_charge_type": "PostPaid",
"kubernetes_version": "1.14.6-aliyun.1",
"addons": [{"name":"terway-eniip"}],
"runtime": {"name": "Sandboxed-Container.runv", "version": "1.0.0"},
"pod_vswitch_ids":["vsw-bp18nj6xxfoc2ci2xxxxx"]
}
Sample success responses
HTTP/1.1 202 Accepted
<Common response parameters>
{
"cluster_id": "cb95aa626a47740afbf6aa099b65****",
"RequestId": "687C5BAA-D103-4993-884B-C35E4314A1E1",
"task_id": "T-5a54309c80282e39ea00002f"
}