Creates an edge container cluster.
Operation description
The call frequency for a single user is limited to 10 calls per second.
Creating a cluster is an asynchronous operation. The cluster takes 10 to 20 minutes to initialize after the API call returns a response. During this time, you can call the DescribeClustersV1 operation to query the cluster creation status. After the cluster is created, you can call the DescribeClusterUserKubeconfig operation to retrieve the cluster certificate.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ens:CreateCluster |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
No |
The name of the cluster. |
mycluster-1 |
| ClusterType |
string |
Yes |
Valid values: Kubernetes or ManagedKubernetes. Kubernetes indicates an ECK cluster. ManagedKubernetes indicates a serverless virtual cluster (VC). This parameter must be used with the Profile parameter. |
Kubernetes |
| Profile |
string |
Yes |
Valid values: Default or Serverless. Default indicates an ECK cluster. Serverless indicates a serverless VC. This parameter must be used with the ClusterType parameter. |
Default |
| EnsRegionId |
string |
No |
The ID of the ENS region where the cluster is located. |
cn-beijing |
| KubernetesVersion |
string |
No |
The cluster version. This must be consistent with the Kubernetes community baseline version. Select the latest version. If you do not specify this parameter, the latest version is used by default. |
1.32.1 |
| VpcId |
string |
No |
The virtual private cloud (VPC) used by the cluster. |
vpc-xxxx |
| VswitchIds |
array |
No |
The IDs of the virtual switches that contain the cluster nodes. The virtual switches must be in the ENS region specified by `ens_region_id`. |
["vsw-xxx", "vsw-yyy"] |
|
string |
No |
A list of virtual switch IDs. |
vsw-xxxxxxxxx |
|
| PodVswitchIds |
array |
No |
Each pod virtual switch corresponds to a worker node virtual switch. The zones of the pod virtual switches and the worker node virtual switches must be the same. If you do not specify this parameter, the value of VswitchIds is used by default. |
|
|
string |
No |
A list of pod virtual switch IDs. |
vsw-xxxxxxxx |
|
| ContainerCidr |
string |
No |
The pod CIDR block. It must be a valid private CIDR block, such as 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16, or their subnets. The CIDR block cannot overlap with the VPC CIDR block or the CIDR blocks of existing Kubernetes clusters in the VPC. This parameter cannot be changed after the cluster is created. |
172.20.0.0/16 |
| ServiceCidr |
string |
No |
The CIDR block for the service must be within one of the following ranges: 10.0.0.0/16-24, 172.16-31.0.0/16-24, or 192.168.0.0/16-24. The CIDR block cannot overlap with the VPC CIDR block 10.1.0.0/21 or the CIDR blocks of existing Kubernetes clusters in the VPC. This setting cannot be changed after the cluster is created. |
172.19.0.0/20 |
| PublicAccess |
boolean |
No |
Specifies whether to enable public network access. The API server is exposed through elastic IP addresses (EIPs) to allow public network access to the cluster. ● true: Enables public network access. ● false: Disables public network access. If you disable public network access, you cannot access the cluster API server from the internet. Default value: false. |
true |
| LoadBalancerId |
string |
No |
The ID of the Classic Load Balancer (CLB) instance used for API server access. If you specify this parameter, a CLB instance for the API server is not automatically created. |
lb-wz9t256gqa3vbouk**** |
| ControlPlaneConfig |
object |
No |
The control plane configuration. |
|
| InstanceSpec |
string |
No |
Specifies the instance type for the node. |
ens.esk.sn1.medium |
| ImageId |
string |
No |
The ID of the virtual machine image for the control plane. |
m-5ul335umat4e2y9ynwi84p3f9 |
| SystemDiskCategory |
string |
No |
The type of the system disk for the edge zone. Valid values: "local_ssd", "cloud_ssd", "cloud_efficiency", and "local_hdd". |
cloud_efficiency |
| SystemDiskSize |
integer |
No |
The size of the node's system disk. |
120 |
| Runtime |
string |
No |
The runtime of the control plane node. |
containerd |
| NodePortRange |
string |
No |
The range of service ports on the nodes. |
30000-32767 |
| Size |
integer |
No |
The number of control plane nodes. Valid values are 3 and 5. |
3 |
| LoginPassword |
string |
No |
The logon password for the cluster control plane machines. |
ThisIsAPassword |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response struct. |
||
| RequestId |
string |
The request ID. |
C0003E8B-B930-4F59-ADC0-0E209A9012A8 |
| ClusterId |
string |
The cluster ID. |
c34b69b095f8241c5a91cc2252dceb976 |
Examples
Success response
JSON format
{
"RequestId": "C0003E8B-B930-4F59-ADC0-0E209A9012A8",
"ClusterId": "c34b69b095f8241c5a91cc2252dceb976"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | BadRequest | Request param error. | Request parameter error |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.