You can call CreateCluster to create a managed edge cluster.
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
{
"disable_rollback":"Specifies whether to retain all resources if the operation fails.",
"name":"The name of the cluster.",
"timeout_mins":"The timeout period for creating a cluster.",
"cluster_type":"The type of the cluster. Set this parameter to ManagedKubernetes.",
"profile":"The identifier of an edge cluster. Default value: Edge.",
"region_id":"The ID of the region.",
"vpcid": "VPC ID",
"vswitch_ids":"The IDs of VSwitches. Specify one to three VSwitch IDs.",
"container_cidr":"The CIDR block of containers.",
"service_cidr": "The CIDR block of services.",
"cloud_monitor_flags":"Specifies whether to install the CloudMonitor agent.",
"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_instance_types":"The ECS instance types of worker nodes.", ",
"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":"Specifies whether to mount data disks to worker nodes. Valid values: true and false.",
"worker_data_disk_category":"The data disk type of worker nodes.",
"worker_data_disk_size":"The data disk size of a worker node.",
"num_of_nodes":"The number of worker nodes.",
"snat_entry":"Specifies whether to configure Source Network Address Translation (SNAT).",
"endpoint_public_access":"Specifies whether to enable Internet access to the endpoint of the cluster.",
"tags":"The tags of the cluster. This parameter must be an array.",
}
Parameter | Type | Required | Description |
---|---|---|---|
cluster_type | string | Yes | The type of the cluster. |
key_pair | string | Yes | The name of the key pair. You must set key_pair or login_password. |
login_password | string | Yes | The SSH logon password. The password must be 8 to 30 characters in length and contain 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, Chinese characters, digits, and hyphens (-). |
num_of_nodes | int | Yes | The number of worker nodes. Valid values: 0 to 300. |
profile | string | Yes | The identifier of an edge cluster. Default value: Edge. |
region_id | string | Yes | The ID of the region where the cluster is deployed. |
snat_entry | bool | Yes | Specifies whether to configure SNAT. If the virtual private cloud (VPC) is automatically created by the system, set the value to true. If an existing VPC is specified, set the value based on whether the VPC has Internet access. |
vswitch_ids | list | Yes | The IDs of VSwitches. Specify one to three VSwitch IDs. |
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. |
container_cidr | string | No | The CIDR block of containers. This CIDR block cannot overlap with that of the VPC. If the VPC is automatically created by the system, the CIDR block of containers is set to 172.16.0.0/16. |
cloud_monitor_flags | bool | No | Specifies whether to install the CloudMonitor agent.
Note
|
disable_rollback | bool | No | Specifies whether to retain all resources if the operation fails. Valid values:
|
proxy_mode | string | No | The kube-proxy mode. Valid values: iptables and ipvs. Default value: iptables. |
endpoint_public_access | bool | No | Specifies whether to enable Internet access to the API server. Default value: true. Valid values:
Note To create a managed edge cluster, enable Internet access to the API server. This allows edge nodes to connect to the management nodes in the cloud over the Internet.
|
service_cidr | string | No | The CIDR block of services. This CIDR block cannot overlap with that of the VPC or containers. If the VPC is automatically created by the system, the CIDR block of services is set to 172.19.0.0/20. |
tags | list | No | The tags of the cluster. A tag contains a key and a value.
|
timeout_mins | int | No | The timeout period in minutes during which a resource creation operation must be completed. Default value: 60. |
vpcid | string | No | The ID of the VPC. If you leave this parameter empty, the system automatically creates a VPC that uses CIDR block 192.168.0.0/16. You must specify both the vpcid and vswitch_ids parameters or leave both parameters empty. |
worker_data_disk | string | No | Specifies whether to mount data disks to worker nodes. Valid values:
|
worker_data_disk_category | int | No | The type of data disks. |
worker_data_disk_size | string | No | The size of a data disk. |
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 .
Response body
{
"cluster_id":"string",
"request_id":"string",
"task_id":"string"
}
Examples
Sample requests
POST /clusters HTTP/1.1
<Common request parameters>
{
"name":"test",
"cluster_type":"ManagedKubernetes",
"profile":"Edge",
"disable_rollback":true,
"timeout_mins":60,
"region_id":"cn-beijing",
"snat_entry":true,
"cloud_monitor_flags":true,
"endpoint_public_access":true,
"tags":[],
"worker_instance_types":["ecs.hfc5.xlarge"],
"num_of_nodes":1,
"worker_system_disk_category":"cloud_efficiency",
"vpcid":"vpc-2zegvl5eta******",
"container_cidr":"172.20.0.0/16",
"service_cidr":"172.21.0.0/20",
"vswitch_ids":["vsw-2ze48rkq464rsdts1****"],
"login_password":"test@19****"
}
Sample responses
HTTP/1.1 202 Accepted
<Common response parameters>
{
"cluster_id": "cb95aa626a47740afbf6aa099b65****",
"RequestId": "687C5BAA-D103-4993-884B-C35E4314****",
"task_id": "T-5a54309c80282e39ea00****"
}