A node pool is a logical group of nodes that share the same properties. Node pools allow you to manage nodes and perform operations and maintenance (O&M) tasks, such as upgrades and auto scaling, on them as a group. You can use the automated O&M features of a node pool to automatically fix operating system (OS) Common Vulnerabilities and Exposures (CVE) vulnerabilities, recover failed nodes, and upgrade kubelet and containerd versions. This helps reduce your O&M costs. Call the CreateClusterNodePool operation to create a node pool for a cluster.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cs:CreateClusterNodePool |
create |
*Cluster
|
None | None |
Request syntax
POST /clusters/{ClusterId}/nodepools HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClusterId |
string |
Yes |
The cluster ID. |
c61da77e8bfbc4c4c999af2b51b65**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
|
| nodepool_info |
object |
No |
The node pool configurations. |
|
| name |
string |
Yes |
The name of the node pool. |
nodepool-test |
| type |
string |
No |
The type of the node pool. Valid values:
Valid values:
|
ess |
| resource_group_id |
string |
No |
The ID of the resource group. Instances that are created in the node pool belong to this resource group. A resource can belong to only one resource group. You can map resource groups to concepts such as projects, applications, or organizations based on your business scenarios. |
rg-acfmyvw3wjmb**** |
| auto_scaling |
object |
No |
The auto scaling configurations. |
|
| enable |
boolean |
No |
Specifies whether to enable auto scaling. Valid values:
If you set this parameter to false, other parameters in `auto_scaling` do not take effect. Default value: |
false |
| type |
string |
No |
The type of instances that are automatically scaled. This parameter takes effect only if `enable` is set to `true`. Valid values:
Default value: Important You cannot change the value of this parameter after the node pool is created. Valid values:
|
cpu |
| max_instances |
integer |
No |
The maximum number of instances that can be created in the node pool. This does not include existing instances. This parameter takes effect only if `enable` is set to `true`. The value must be in the range of [`min_instances`, 2000]. Default value: 0. |
10 |
| min_instances |
integer |
No |
The minimum number of instances that can be created in the node pool. This does not include existing instances. This parameter takes effect only if `enable` is set to `true`. The value must be in the range of [0, `max_instances`]. Default value: 0. Note
|
1 |
is_bond_eip
deprecated
|
boolean |
No |
[This parameter is deprecated] This parameter is deprecated. Use `internet_charge_type` and `internet_max_bandwidth_out` instead. Specifies whether to associate an EIP with the node. Valid values:
Default value: |
null |
eip_internet_charge_type
deprecated
|
string |
No |
[This parameter is deprecated] Use `internet_charge_type` and `internet_max_bandwidth_out` instead. The billing method of the EIP. Valid values:
Default value: |
null |
eip_bandwidth
deprecated
|
integer |
No |
[This parameter is deprecated] Use `internet_charge_type` and `internet_max_bandwidth_out` instead. The peak bandwidth of the EIP. Unit: Mbps. |
null |
| management |
object |
No |
The configurations of the managed node pool feature. |
|
| enable |
boolean |
No |
Specifies whether to enable the managed node pool feature. Valid values:
Default value: false. |
false |
| auto_repair |
boolean |
No |
Specifies whether to enable auto node repair. This parameter takes effect only if `enable` is set to `true`.
Default value: |
true |
| auto_repair_policy |
object |
No |
The auto node repair policy. |
|
| restart_node |
boolean |
No |
Specifies whether to allow node restart. This parameter takes effect only if `auto_repair` is set to `true`. Valid values:
Default value: |
true |
| approval_required |
boolean |
No |
Specifies whether manual approval is required for node repair. |
|
| auto_vul_fix |
boolean |
No |
Specifies whether to automatically fix CVE vulnerabilities. This parameter takes effect only if `enable` is set to `true`.
Default value: |
true |
| auto_vul_fix_policy |
object |
No |
The policy for automatically fixing CVE vulnerabilities. |
|
| restart_node |
boolean |
No |
Specifies whether to allow node restart. This parameter takes effect only if `auto_vul_fix` is set to `true`. Valid values:
Default value: |
false |
| vul_level |
string |
No |
The vulnerability levels that are allowed to be automatically fixed. Separate multiple levels with commas. Example:
Default value: |
asap,nntf |
| exclude_packages |
string |
No |
The packages that should be excluded from vulnerability fixing. Default value: |
kernel |
| auto_upgrade |
boolean |
No |
Specifies whether to enable auto node upgrade. This parameter takes effect only if `enable` is set to `true`.
Default value: |
true |
| auto_upgrade_policy |
object |
No |
The auto node upgrade policy. |
|
| auto_upgrade_kubelet |
boolean |
No |
Specifies whether to allow auto kubelet upgrade. This parameter takes effect only if `auto_upgrade` is set to `true`. Valid values:
Default value: |
true |
| auto_upgrade_runtime |
boolean |
No |
Specifies whether to allow auto runtime upgrade. This parameter takes effect only if `auto_upgrade` is set to `true`. Valid values:
Default value: |
false |
| auto_upgrade_os |
boolean |
No |
Specifies whether to allow auto OS upgrade. This parameter takes effect only if `auto_upgrade` is set to `true`. Valid values:
Default value: |
false |
upgrade_config
deprecated
|
object |
No |
[This parameter is deprecated] Use the `auto_upgrade` parameter instead. The auto upgrade configurations. This parameter takes effect only if `enable` is set to `true`. |
|
auto_upgrade
deprecated
|
boolean |
No |
[This parameter is deprecated] Use the `auto_upgrade` parameter instead. Specifies whether to enable auto upgrade. Valid values:
|
null |
| surge |
integer |
No |
The number of extra nodes. You can specify only one of `surge` and `surge_percentage`. Nodes become unavailable during an upgrade. You can create extra nodes to compensate for the load on the cluster. Note
We recommend that the number of extra nodes does not exceed the current number of nodes. |
0 |
| surge_percentage |
integer |
No |
The percentage of extra nodes. You can specify only one of `surge` and `surge_percentage`. Number of extra nodes = Percentage of extra nodes × Number of nodes. For example, if you set the percentage of extra nodes to 50% and the number of existing nodes is 6, three extra nodes are created. |
0 |
| max_unavailable |
integer |
No |
The maximum number of unavailable nodes. The value must be in the range of [1, 1000]. Default value: 1. |
1 |
| auto_fault_diagnosis |
boolean |
No |
||
| scaling_group |
object |
No |
The configurations of the scaling group for the node pool. |
|
| vswitch_ids |
array |
Yes |
A list of vSwitch IDs. The number of vSwitch IDs must be in the range of [1, 8]. Note
For high availability, we recommend that you select vSwitches in different zones. |
|
|
string |
No |
The vSwitch ID. |
vsw-wz9mfnhmssud6eicu**** |
|
| instance_types |
array |
Yes |
A list of instance types for the nodes in the node pool. When the system creates nodes in the node pool, it selects an instance type from the list that meets the requirements. The number of instance types must be in the range of [1, 10]. Note
For high availability, we recommend that you select multiple instance types. |
|
|
string |
No |
The instance type. For more information, see Instance families. |
ecs.d1ne.2xlarge |
|
| instance_charge_type |
string |
Yes |
The billing method of the nodes in the node pool. Valid values:
Default value: Valid values:
|
PostPaid |
| period |
integer |
No |
The subscription duration of the nodes in the node pool. This parameter is required and takes effect only if `instance_charge_type` is set to `PrePaid`.
|
1 |
| period_unit |
string |
No |
The billing cycle of the nodes in the node pool. This parameter is required and takes effect only if `instance_charge_type` is set to `PrePaid`.
Default value: |
Month |
| auto_renew |
boolean |
No |
Specifies whether to enable auto-renewal for the nodes in the node pool. This parameter takes effect only if `instance_charge_type` is set to `PrePaid`. Valid values:
Default value: |
true |
| auto_renew_period |
integer |
No |
The auto-renewal period. Valid values:
Default value: 1. |
1 |
| spot_strategy |
string |
No |
The bidding policy for the spot instances. Valid values:
For more information, see Spot instances. |
NoSpot |
| spot_price_limit |
array<object> |
No |
The configurations of the price range for a single spot instance. |
|
|
object |
No |
The configurations of the price range for a spot instance. You can set different price ranges for different instance types. |
||
| instance_type |
string |
No |
The instance type of the spot instance. |
ecs.c6.large |
| price_limit |
string |
No |
The maximum bid price for a single instance. |
0.39 |
| image_type |
string |
No |
The OS image type. Valid values:
|
AliyunLinux3 |
| image_id |
string |
No |
The ID of the custom image. By default, the system-provided image is used. |
aliyun_2_1903_x64_20G_alibase_20200529.vhd |
| system_disk_category |
string |
No |
The type of the system disk of the node. Valid values:
Default value: |
cloud_efficiency |
| system_disk_categories |
array |
No |
The types of system disks. If a disk of a high-priority type is unavailable, the system automatically uses a disk of the next priority type to create the system disk. |
|
|
string |
No |
The types of system disks for the node. Valid values:
|
cloud_essd |
|
| system_disk_size |
integer |
No |
The size of the system disk of the node. Unit: GiB. The value must be in the range of [20, 2048]. |
120 |
| system_disk_performance_level |
string |
No |
The performance level of the system disk for each node. This parameter applies only to Enhanced SSD (ESSD) disks. The performance level of an ESSD is determined by its size. For more information, see ESSD cloud disks.
|
PL1 |
| system_disk_encrypted |
boolean |
No |
Specifies whether to encrypt the system disk. Valid values:
|
false |
| system_disk_kms_key_id |
string |
No |
The ID of the KMS key that is used to encrypt the system disk. |
0e478b7a-4262-4802-b8cb-00d3fb40**** |
| system_disk_encrypt_algorithm |
string |
No |
The encryption algorithm that is used to encrypt the system disk. Valid value: aes-256. |
aes-256 |
| system_disk_bursting_enabled |
boolean |
No |
Specifies whether to enable the performance burst feature for the system disk of the node. Valid values:
This parameter can be set only when `system_disk_category` is set to `cloud_auto`. For more information, see ESSD AutoPL disks. |
true |
| system_disk_provisioned_iops |
integer |
No |
The provisioned read/write IOPS of the system disk of the node. Valid values: 0 to min{50,000, 1,000 × Capacity - Baseline IOPS}. Baseline IOPS = min{1,800 + 50 × Capacity, 50,000}. This parameter can be set only when `system_disk_category` is set to `cloud_auto`. For more information, see ESSD AutoPL disks. |
1000 |
| data_disks |
array |
No |
The data disk configurations of the nodes in the node pool. |
|
| data_disk |
No |
The data disk configurations. |
||
| disk_init |
array |
No |
The block device initialization configurations. |
|
|
DiskInit |
No |
The DiskInit configurations. |
||
| security_group_ids |
array |
No |
A list of security group IDs. You must specify one of `security_group_ids` and `security_group_id`. We recommend that you specify `security_group_ids`. If you specify both `security_group_id` and `security_group_ids`, `security_group_ids` takes precedence. |
|
|
string |
No |
A list of security group IDs. You must specify one of `security_group_ids` and `security_group_id`. We recommend that you specify `security_group_ids`. If you specify both `security_group_id` and `security_group_ids`, `security_group_ids` takes precedence. |
sg-wz9a8g2mt6x5ll****** |
|
| key_pair |
string |
No |
The name of the key pair that is used for passwordless logon. You must specify one of `key_pair` and `login_password`. Note
If you select Container-Optimized OS for the node pool, you can use only `key_pair`. |
np-key-name |
| login_password |
string |
No |
The SSH logon password. You must specify one of `key_pair` and `login_password`. The password must be 8 to 30 characters in length, and contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. |
**** |
| login_as_non_root |
boolean |
No |
Specifies whether to log on to the created ECS instances as a non-root user.
|
true |
cis_enabled
deprecated
|
boolean |
No |
[Deprecated] Use the `security_hardening_os` parameter instead. |
null |
| soc_enabled |
boolean |
No |
Specifies whether to enable MLPS 2.0 security hardening. You can enable MLPS 2.0 security hardening for nodes only when you select Alibaba Cloud Linux 2 or Alibaba Cloud Linux 3 for the OS image. Alibaba Cloud provides baseline check standards and scanning programs for Alibaba Cloud Linux 2 and Alibaba Cloud Linux 3 Level 3 of MLPS 2.0 to ensure classified protection compliance. |
false |
| security_hardening_os |
boolean |
No |
Alibaba Cloud OS security hardening. Valid values:
Default value: |
false |
| internet_charge_type |
string |
No |
The billing method of the public IP address. Valid values:
|
PayByTraffic |
| internet_max_bandwidth_out |
integer |
No |
The maximum outbound public bandwidth of the node. Unit: Mbit/s. The value must be in the range of [1, 100]. |
5 |
| tags |
array<object> |
No |
The tags that you want to add only to ECS instances. A tag key cannot be repeated. The tag key can be up to 128 characters in length. The tag key and the tag value cannot start with “aliyun” or “acs:”, and cannot contain “https://” or “http://”. |
|
|
object |
No |
The node tag. |
||
| key |
string |
No |
The name of the tag. |
node-k-1 |
| value |
string |
No |
The tag value. |
node-v-1 |
| desired_size |
integer |
No |
The expected number of nodes in the node pool. The total number of nodes that the node pool should maintain. We recommend that you configure at least two nodes to ensure that cluster components run as expected. You can adjust the expected number of nodes to scale out or scale in the node pool. If you do not need to create nodes, set this parameter to 0. You can manually adjust the number of nodes later. |
0 |
| multi_az_policy |
string |
No |
The scaling policy for the ECS instances in the multi-zone scaling group. Valid values:
Default value: |
COST_OPTIMIZED |
| scaling_policy |
string |
No |
The scaling mode of the scaling group. Valid values:
Default value: |
release |
| on_demand_base_capacity |
integer |
No |
The minimum number of pay-as-you-go instances that must be included in the scaling group. The value must be in the range of [0, 1000]. If the number of pay-as-you-go instances is less than this value, the system gives priority to creating pay-as-you-go instances. |
0 |
| on_demand_percentage_above_base_capacity |
integer |
No |
The percentage of pay-as-you-go instances among the extra instances that are created after the minimum number of pay-as-you-go instances (`on_demand_base_capacity`) is met. The value must be in the range of [0, 100]. |
20 |
| spot_instance_pools |
integer |
No |
The number of instance types that you can specify. The scaling group creates preemptible instances of multiple instance types that are available at the lowest cost. The value must be in the range of [1, 10]. |
5 |
| spot_instance_remedy |
boolean |
No |
Specifies whether to enable the instance reclaim mode. After this mode is enabled, when the system receives a message that a spot instance is about to be reclaimed, the scaling group attempts to create a new instance to replace the instance that is about to be reclaimed. Valid values:
|
false |
| compensate_with_on_demand |
boolean |
No |
Specifies whether to automatically create pay-as-you-go instances to meet the instance quantity requirement when `multi_az_policy` is set to `COST_OPTIMIZED` and spot instances cannot be created due to issues such as price or insufficient inventory. Valid values:
|
true |
| deploymentset_id |
string |
No |
The ID of the deployment set. You can use a deployment set to distribute the ECS instances created in the node pool across different physical servers to ensure high availability and underlying disaster recovery. When you create ECS instances in a deployment set, the instances are launched in the specified region based on the deployment strategy that you set. Important After you select a deployment set, the maximum number of nodes in the node pool is limited. By default, a deployment set supports a maximum of 20 × Number of zones (the number of zones is determined by the vSwitches) nodes. Select a deployment set with sufficient quota to prevent node creation failures. |
ds-bp1d19mmbsv3jf6xxxxx |
| rds_instances |
array |
No |
A list of RDS instances. |
|
|
string |
No |
The ID of the RDS instance. |
rds-**** |
|
| private_pool_options |
object |
No |
The private pool configurations. |
|
| id |
string |
No |
The ID of the private pool. You must specify the private pool ID when `match_criteria` is set to `Target`. |
eap-bp67acfmxazb4**** |
| match_criteria |
string |
No |
The type of the private pool. This parameter specifies the capacity of the private pool that you want to use to launch instances. An elastic assurance service or a capacity reservation service takes effect after it is generated. You can select a capacity type when you launch an instance. Valid values:
|
Target |
security_group_id
deprecated
|
string |
No |
The ID of the security group for the node pool. You must specify one of `security_group_ids` and `security_group_id`. We recommend that you specify `security_group_ids`. |
sg-wz9a8g2mt6x5llu0**** |
platform
deprecated
|
string |
No |
[This parameter is deprecated] Use the `image_type` parameter instead. The OS distribution. Valid values:
Default value: |
null |
| instance_patterns |
array |
No |
The instance property configurations. |
|
| instance_patterns |
No |
The instance properties. |
||
| ram_role_name |
string |
No |
The name of the worker RAM role.
Important This parameter is supported only by ACK managed clusters of Kubernetes 1.22 or later. |
example-role |
| instance_metadata_options | InstanceMetadataOptions |
No |
The ECS instance metadata access configurations. |
|
| resource_pool_options |
object |
No |
The resource pool and policy used to create instances. Note: This parameter takes effect only when you create pay-as-you-go instances. This parameter cannot be set at the same time as `private_pool_options.match_criteria` and `private_pool_options.id`. |
|
| strategy |
string |
No |
The resource pool policy for instance creation. Resource pools include private pools (generated by elastic assurance or capacity reservation services) and public pools. Valid values: PrivatePoolFirst: Prioritizes private pools. If you specify `resouce_pool_options.private_pool_ids`, the specified private pools are used first. If no private pool is specified or the specified pools have insufficient capacity, the system automatically tries to use open private pools. If no suitable private pool is found, the public pool is used. PrivatePoolOnly: Uses only private pools. You must specify `resouce_pool_options.private_pool_ids`. If the specified private pools have insufficient capacity, the instance fails to launch. None: No resource pool policy is used. Default value: None. |
PrivatePoolFirst |
| private_pool_ids |
array |
No |
A list of private pool IDs. These are the IDs of elastic assurance services or capacity reservation services. You can only specify the IDs of private pools in Target mode. The number of IDs must be in the range of 1 to 20. |
|
|
string |
No |
The private pool ID. This is the ID of an elastic assurance service or a capacity reservation service. You can only specify the ID of a private pool in Target mode. |
eap-bp67acfmxazb4**** |
|
| system_disk_snapshot_policy_id |
string |
No |
The snapshot policy for the system disk. |
sp-0jl6xnmme8v7o935**** |
| node_config |
object |
No |
The node configurations. |
|
| kubelet_configuration | kubelet_config |
No |
The Kubelet parameter settings. |
|
| kubernetes_config |
object |
No |
The cluster-related configurations. |
|
| labels |
array |
No |
The labels that you want to add to the nodes in the Kubernetes cluster. |
|
| tag |
No |
The tag configurations. |
||
| taints |
array |
No |
The taint configurations. |
|
| taint |
No |
A collection of taint configurations. |
||
| runtime |
string |
No |
The name of the container runtime. ACK supports the following three container runtimes.
Default value: containerd. |
containerd |
| runtime_version |
string |
No |
The version of the container runtime. |
1.6.38 |
| cpu_policy |
string |
No |
The CPU management policy of the node. The following policies are supported if the Kubernetes version of the cluster is 1.12.6 or later:
Default value: |
none |
| user_data |
string |
No |
The instance user data. After the node joins the cluster, the specified user data script is run. For more information, see User-Data scripts. |
dGhpcyBpcyBhIGV4YW1wbGU= |
| unschedulable |
boolean |
No |
Specifies whether the scaled-out nodes are unschedulable.
|
true |
| cms_enabled |
boolean |
No |
Specifies whether to install Cloud Monitor on the ECS nodes. After Cloud Monitor is installed, you can view the monitoring information of the created ECS instances in the Cloud Monitor console. We recommend that you enable this feature. Valid values:
Default value: |
false |
| node_name_mode |
string |
No |
The custom node name. If you customize the node name, the node name, ECS instance name, and ECS instance hostname are changed. Note
For Windows instances for which custom node names are enabled, the hostname is fixed as the IP address. Hyphens (-) are used to replace periods (.) in the IP address. The hostname does not contain a prefix or a suffix. A node name consists of a prefix, the node IP address, and a suffix.
For example, if the node IP address is 192.XX.YY.55, the prefix is aliyun.com, and the suffix is test.
|
aliyun.com192.XX.YY.55test |
| pre_user_data |
string |
No |
The pre-join instance user data. The specified user data script is run before the node joins the cluster. For more information, see User-Data scripts. |
dGhpcyBpcyBhIGV4YW1wbGU |
| tee_config |
object |
No |
The configurations of the confidential computing cluster. |
|
| tee_enable |
boolean |
No |
Specifies whether to enable the confidential computing cluster.
|
true |
interconnect_config
deprecated
|
object |
No |
[This parameter is deprecated] The configurations of the edge node pool. |
|
| cen_id |
string |
No |
[This parameter is deprecated] The ID of the CEN instance that is associated with the enhanced edge node pool. |
null |
| ccn_id |
string |
No |
[This parameter is deprecated] The ID of the CCN instance that is associated with the enhanced edge node pool. |
null |
| ccn_region_id |
string |
No |
[This parameter is deprecated] The region of the CCN instance that is associated with the enhanced edge node pool. |
null |
| bandwidth |
integer |
No |
[This parameter is deprecated] The network bandwidth of the enhanced edge node pool. Unit: Mbps. |
null |
| improved_period |
string |
No |
[This parameter is deprecated] The subscription duration of the enhanced edge node pool. Unit: months. |
null |
count
deprecated
|
integer |
No |
[This parameter is deprecated] Use desired_size instead. The number of nodes in the node pool. |
null |
max_nodes
deprecated
|
integer |
No |
[This parameter is deprecated] The maximum number of nodes that the edge node pool can contain. |
null |
| interconnect_mode |
string |
No |
The network type of the edge node pool. This parameter takes effect only for node pools of the `edge` type. Valid values:
|
basic |
| host_network |
boolean |
No |
Specifies whether to use the host network for the pod network.
|
true |
| intranet |
boolean |
No |
Specifies whether nodes in the edge node pool can communicate with each other at Layer 3.
|
true |
| eflo_node_group |
object |
No |
The Lingjun node pool configurations. |
|
| cluster_id |
string |
No |
The ID of the Lingjun cluster that you want to associate with the Lingjun node pool when you create the node pool. |
i1169130516633730**** |
| group_id |
string |
No |
The ID of the Lingjun group in the Lingjun cluster that you want to associate with the Lingjun node pool when you create the node pool. |
ng-ec3c96ff0aa**** |
| auto_mode |
object |
No |
The intelligent managed node pool configurations. |
|
| enable |
boolean |
No |
Specifies whether to enable the intelligent managed mode. Valid values:
|
true |
| node_components |
array<object> |
No |
A list of node components. |
|
|
array<object> |
No |
The node component. |
||
| name |
string |
No |
The name of the node component. |
kubelet |
| version |
string |
No |
The version of the node component. |
1.33.3-aliyun.1 |
| config |
object |
No |
The configurations of the node component. |
|
| custom_config |
object |
No |
The custom configurations of the node component. |
|
|
string |
No |
The custom configuration string of the node component. |
cpuManagerPolicy |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The node pool configurations. |
||
| nodepool_id |
string |
The node pool ID. |
np31da1b38983f4511b490fc62108a**** |
| task_id |
string |
The task ID. |
T-613b19bbd160ad492800**** |
| request_id |
string |
The request ID. |
0527ac9a-c899-4341-a21a-**** |
Examples
Success response
JSON format
{
"nodepool_id": "np31da1b38983f4511b490fc62108a****",
"task_id": "T-613b19bbd160ad492800****",
"request_id": "0527ac9a-c899-4341-a21a-****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.