You can call CreateCluster to create a managed edge Kubernetes cluster instance.

Request

Request format

POST /clusters HTTP/1.1 

Custom request headers

None. See Public request headers.

Request body

{
"disable_rollback": "whether to roll back when the operation fails",
"name": "cluster name",
"timeout_mins": "cluster creation timeout",
"cluster_type": "cluster type. ManagedKubernetes",
"profile":"profile of the edge cluster. Edge",
"region_id": "region",
"vpcid": "VPC ID",
"worker_vswitch_ids":  "one or multiple VSwitch IDs. The number of VSwitch IDs can be 1, 2, 3, 4, or 5",
"container_cidr": "POD CIDR Block",
"service_cidr": "Service CIDR Block",
"cloud_monitor_flags":"whether to install the CloudMonitor agent",
"login_password": "SSH logon password. Select one between SSH authentication and key pair authentication",
"key_pair":"key pair name. Select one between SSH authentication and key pair authentication",
"worker_instance_types": "multiple instance types from which Worker instances are to be created",
"worker_system_disk_category": "system disk type of Worker nodes",
"worker_system_disk_size": "system disk size of Worker nodes",
"worker_data_disk":"whether data disks are attached to Worker nodes. Valid values: true or false",
"worker_data_disk_category":"type of the data disks",
"worker_data_disk_size":"size of the data disks",
"num_of_nodes": "number of Worker nodes",
"snat_entry": "whether to configure SNAT entries",
"endpoint_public_access": "whether the public network exposes the cluster endpoint",
"tags": "cluster tags in an array object"
}
Table 1. Request body parameters
Parameter Type Required Description
cluster_type string Yse The type of the cluster.
key_pair string Yse The keypair name. Select one between login_password and key_pair.
login_password string Yse The SSH logon password. The password must be 8 to 30 characters in length and contain letters, numbers, and special characters. Select one between login_password and key_pair.
name string Yse The cluster name. The name can contain uppercase and lowercase letters, Chinese characters, digits, and hyphens (-).
num_of_nodes Integer Yes The number of Worker nodes. Valid values: [0, 300]
profile string Yse The profile of the edge cluster. Default value: Edge.
region_id string Yse The ID of the region where the cluster is located.
snat_entry bool Yes Whether to configure SNAT. If the VPC network is automatically created, this parameter must be set to true. If an existing VPC network is used, configure this parameter as follows:
vswitch_ids list Yes The IDs of the VSwitch. The list can contain 1 to 3 list elements.
worker_system_disk_category string Yse The system disk type of Worker nodes.
worker_system_disk_size Integer Yes The system disk size of Worker nodes.
container_cidr string No The CIDR block associated with the container. This CIDR block must not overlap with that of the VPC network. If the VPC network is automatically created by the system, the container is associated with CIDR block 172.16.0.0/16 by default.
cloud_monitor_flags bool No Whether to install the CloudMonitor agent.
Note If you choose to use the log service or monitoring service, a cloud ECS node is automatically purchased to deploy the corresponding services. In this case, you must configure the logon information and resource specifications of the Worker node.
disable_rollback bool No Whether to roll back when the operation fails.
  • true: A value of true indicates no.
  • false: A value of true indicates yes.
If you choose to roll back when the operation fails, resources created during the operation are released. We recommend that you choose true
proxy_mode string No The kube-proxy mode. The iptables and IPVS modes are supported. The default mode is iptables.
endpoint_public_access bool No Whether to allow public access to the API Server.
  • A value of true indicates that public access to the API Server is allowed. Default value: true.
  • A value of false indicates that public access to the API Server is denied.
Note In the edge cluster scenario, the edge nodes interact with the cloud through the public network. Therefore, the edge cluster must enable the public network access.
service_cidr string No The service CIDR block. This CIDR block must not overlap with that of the VPC network or container. If the VPC network is automatically created by the system, the service CIDR block is set to 172.19.0.0/20 by default.
tags list No Tag the cluster:
  • key: The name of the tag.
  • value: The value of the tag.
timeout_mins int No The maximum time in minutes during which the cluster creation operation must be completed. Default: 60.
vpcid string No The ID of the VPC network where the cluster is deployed. Optional. If this parameter is not specified, the system automatically creates a VPC network with CIDR block 192.168.0.0/16. Parameter vpcid and vswitchid must be used together.
worker_data_disk string No Whether data disks are attached to Worker nodes. Valid values:
  • A value of true indicates yes.
  • A value of false indicates no.
worker_data_disk_category int No The type of the data disk.
worker_data_disk_size string No The size of the data disk.

Response

Response format

HTTP/1.1 202 Accepted

Custom response headers

None. See Public response headers.

Response body

{
"cluster_id":"string",
"request_id":"string",
"task_id":"string"
}

Samples

Sample requests

POST /clusters HTTP/1.1
<Common request header>
{
"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 header>
{
    "cluster_id": "cb95aa626a47740afbf6aa099b65****",
    "request_id": "687C5BAA-D103-4993-884B-C35E4314****",
    "task_id": "T-5a54309c80282e39ea00****"
}