A node pool is a logical group of nodes with the same properties, enabling unified management and operations such as node upgrades and autoscaling. A node pool's automated features also reduce operations costs. For example, it can automatically remediate OS CVE vulnerabilities, recover failed nodes, and upgrade the kubelet and containerd. Call CreateClusterNodePool to create a node pool.
Operation description
Single-user call rate: 10 calls per second.
Creating a cluster is an asynchronous operation. After the API call returns, cluster initialization takes 10 to 20 minutes. During this process, you can call DescribeClustersV1 to query the cluster creation status. Once the cluster is created, call DescribeClusterUserKubeconfig to retrieve the cluster certificate.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ens:CreateClusterNodePool |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClusterId |
string |
Yes |
The cluster ID. |
eck-xxxxxxxx |
| NodepoolInfo |
object |
Yes |
The node pool configuration. |
|
| Name |
string |
Yes |
The name of the node pool. |
test1 |
| ScalingGroup |
object |
Yes |
The scaling group configuration. |
|
| DesiredSize |
integer |
No |
The desired number of instances in the node pool. |
3 |
| KeyPairName |
string |
No |
The name of the key pair for the instances. You must specify either this parameter or |
key-pair-name |
| VswitchIds |
array |
Yes |
The IDs of the vSwitches used by the instances. |
|
|
string |
No |
The ID of a vSwitch for the cluster nodes. The vSwitch must be in the ENS region specified by |
vsw-58eu2p6v64qw8ihhit1wz7wgv |
|
| InstanceChargeType |
string |
No |
The billing method for the instances. |
PostPaid |
| InstanceTypes |
array |
Yes |
The instance types for the node pool. |
|
|
string |
No |
The instance type. |
ens.sn1.small |
|
| SystemDiskCategory |
string |
No |
The category of the system disk. Valid values: |
cloud_efficiency |
| SystemDiskSize |
integer |
No |
The size of the system disk, in GB. The value must be at least 20 and a multiple of 10. |
80 |
| ImageId |
string |
Yes |
The ID of the image for the instances. |
m-6734fzvcwcv2o8jj201cpa7ox |
| DataDisks |
array<object> |
No |
The data disks to attach to the instances. |
|
|
object |
No |
The configuration of a data disk. |
||
| Category |
string |
No |
The category of the data disk. |
cloud_efficiency |
| Size |
integer |
No |
The size of the data disk, in GB. The value must be at least 20 and a multiple of 10. |
80 |
| Password |
string |
No |
The password for the instances in the node pool. You must specify either this parameter or |
some-test-password |
| KubernetesConfig |
object |
No |
The Kubernetes configuration. |
|
| PreUserData |
string |
No |
A Base64-encoded script to run on an instance after it is created but before it joins the cluster. |
ZWNobyBvawo= |
| UserData |
string |
No |
A Base64-encoded script to run on an instance after it joins the cluster. |
ZWNobyBvawo= |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response data. |
||
| Nodepool |
object |
The configuration of the node pool. |
|
| ClusterId |
string |
The cluster ID. |
eck-d2666c5f |
| NodepoolInfo |
object |
Information about the node pool. |
|
| Name |
string |
The name of the node pool. |
test1 |
| EnsRegionId |
string |
The ID of the ENS region where the cluster is located. |
cn-guiyang-14 |
| NodepoolId |
string |
The ID of the node pool. |
np1176939548ac49e59febe82dcbf1ad56 |
| ScalingGroup |
object |
The configuration of the associated scaling group. Note
The scaling group is assigned to a specified resource group. If one is not specified during creation, the default resource group is used. |
|
| VswitchIds |
array |
The IDs of the VSwitches for the cluster nodes. |
|
|
string |
The ID of the VSwitch. |
vsw-58eu2p6v64qw8ihhit1wz7wgv |
|
| DataDisks |
array<object> |
Information about the data disks for the nodes. |
|
|
object |
Information about a data disk. |
||
| Category |
string |
The category of the data disk. |
cloud_efficiency |
| Size |
integer |
The size of the data disk, in GB. |
80 |
| InstanceChargeType |
string |
The billing method for the instances. |
PrePaid |
| InstanceTypes |
array |
The instance types for the nodes in the node pool. |
|
|
string |
An instance type. |
ens.sn1.small |
|
| SystemDiskCategory |
string |
The category of the system disk. |
cloud_efficiency |
| SystemDiskSize |
integer |
The size of the system disk, in GB. |
80 |
| ImageId |
string |
The ID of the image used for the nodes. |
m-67bdk1kpu1ylmt7k33h5dbiov |
| KeyPairName |
string |
The name of the key pair. |
key-pair-name |
| Password |
string |
The login password for the instances. |
********** |
| KubernetesConfig |
object |
The Kubernetes-related configuration. |
|
| PreUserData |
string |
A Base64-encoded script that executes on an instance after creation but before the node joins the cluster. |
ZWNobyBvawo= |
| UserData |
string |
A Base64-encoded script that is executed on an instance after it joins the cluster. |
ZWNobyBvawo= |
| Status |
object |
The status of the node pool. |
|
| State |
string |
The state of the node pool. Valid values:
|
active |
| TotalNodes |
integer |
The total number of instances in the node pool. This includes instances that are being created, are in service, or are being removed. |
10 |
| DesiredNodes |
integer |
The desired number of instances. |
10 |
| ServingNodes |
integer |
The number of instances that are in service. |
10 |
| InitialNodes |
integer |
The number of instances that are being created. |
0 |
| RemovingNodes |
integer |
The number of instances that are being removed. |
0 |
| FailedNodes |
integer |
The number of failed instances. |
0 |
| RequestId |
string |
The request ID. |
C0003E8B-B930-4F59-ADC0-0E209A9012A8 |
Examples
Success response
JSON format
{
"Nodepool": {
"ClusterId": "eck-d2666c5f",
"NodepoolInfo": {
"Name": "test1",
"EnsRegionId": "cn-guiyang-14",
"NodepoolId": "np1176939548ac49e59febe82dcbf1ad56"
},
"ScalingGroup": {
"VswitchIds": [
"vsw-58eu2p6v64qw8ihhit1wz7wgv"
],
"DataDisks": [
{
"Category": "cloud_efficiency",
"Size": 80
}
],
"InstanceChargeType": "PrePaid",
"InstanceTypes": [
"ens.sn1.small"
],
"SystemDiskCategory": "cloud_efficiency",
"SystemDiskSize": 80,
"ImageId": "m-67bdk1kpu1ylmt7k33h5dbiov",
"KeyPairName": "key-pair-name",
"Password": "**********"
},
"KubernetesConfig": {
"PreUserData": "ZWNobyBvawo=",
"UserData": "ZWNobyBvawo="
},
"Status": {
"State": "active",
"TotalNodes": 10,
"DesiredNodes": 10,
"ServingNodes": 10,
"InitialNodes": 0,
"RemovingNodes": 0,
"FailedNodes": 0
}
},
"RequestId": "C0003E8B-B930-4F59-ADC0-0E209A9012A8"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.