A node pool is a logical collection of a group of nodes with the same attributes, allowing unified management and O&M of nodes, such as node upgrades and auto scaling. You can further leverage the automated O&M capabilities of node pools, including automatic OS CVE vulnerability patching, automatic faulty node recovery, and automatic kubelet and containerd version upgrades, to reduce O&M costs. You can call CreateClusterNodePool 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 |
Cluster ID. |
c61da77e8bfbc4c4c999af2b51b65**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
Request body parameters. |
|
| nodepool_info |
object |
No |
Node pool configuration. |
|
| name |
string |
Yes |
Node pool name. |
nodepool-test |
| type |
string |
No |
Node pool type. Valid values:
Valid values:
|
ess |
| resource_group_id |
string |
No |
Resource group ID of the node pool. Instances created by the node pool will belong to this resource group. A resource can only belong to one resource group. Depending on business scenarios, you can map resource groups to concepts such as projects, applications, or organizations. |
rg-acfmyvw3wjmb**** |
| auto_scaling |
object |
No |
Auto scaling configuration. |
|
| enable |
boolean |
No |
Whether to enable auto scaling. Valid values:
When set to false, other configuration parameters within Default value: |
false |
| type |
string |
No |
Auto scaling instance type. Only takes effect when
Default value: Important This field cannot be modified after the node pool is created. Valid values:
|
cpu |
| max_instances |
integer |
No |
Maximum number of scalable instances in the node pool, excluding your existing instances. Only takes effect when Valid values: [min_instances, 2000]. Default value: 0. |
10 |
| min_instances |
integer |
No |
Minimum number of scalable instances in the node pool, excluding your existing instances. Only takes effect when Valid values: [0, max_instances]. Default value: 0. Note
|
1 |
is_bond_eip
deprecated
|
boolean |
No |
[Deprecated] This field is deprecated. Use internet_charge_type and internet_max_bandwidth_out instead. Whether to bind an EIP. Valid values:
Default value: |
null |
eip_internet_charge_type
deprecated
|
string |
No |
[Deprecated] Use internet_charge_type and internet_max_bandwidth_out instead. EIP billing type. Valid values:
Default value: |
null |
eip_bandwidth
deprecated
|
integer |
No |
[Deprecated] Use internet_charge_type and internet_max_bandwidth_out instead. EIP peak bandwidth. Unit: Mbps. |
null |
| management |
object |
No |
Node pool managed feature configuration. |
|
| enable |
boolean |
No |
Whether to enable the managed feature of the node pool. Valid values:
Default value: false. |
false |
| auto_repair |
boolean |
No |
Whether to automatically repair nodes. Only takes effect when
Default value: |
true |
| auto_repair_policy |
object |
No |
Auto repair node policy. |
|
| restart_node |
boolean |
No |
Specifies whether to allow node restarts. This parameter takes effect only when
Default value: |
true |
| approval_required |
boolean |
No |
Specifies whether manual approval is required for node repair. |
|
| auto_vul_fix |
boolean |
No |
Whether to automatically fix CVE vulnerabilities. Only takes effect when
Default value: |
true |
| auto_vul_fix_policy |
object |
No |
Auto CVE fix policy. |
|
| restart_node |
boolean |
No |
Specifies whether to allow node restarts. This parameter takes effect only when
Default value: |
false |
| vul_level |
string |
No |
The vulnerability levels that are allowed for automatic fixes, separated by commas. Example:
Default value: |
asap,nntf |
| exclude_packages |
string |
No |
The packages to exclude during vulnerability fixes. Default value: |
kernel |
| auto_upgrade |
boolean |
No |
Whether to automatically upgrade nodes. Only takes effect when
Default value: |
true |
| auto_upgrade_policy |
object |
No |
Auto upgrade node policy. |
|
| auto_upgrade_kubelet |
boolean |
No |
Specifies whether to allow automatic kubelet upgrades. This parameter takes effect only when
Default value: |
true |
| auto_upgrade_runtime |
boolean |
No |
Specifies whether to allow automatic runtime upgrades. This parameter takes effect only when
Default value: |
false |
| auto_upgrade_os |
boolean |
No |
Specifies whether to allow automatic operating system upgrades. This parameter takes effect only when
Default value: |
false |
upgrade_config
deprecated
|
object |
No |
[Deprecated] Use the parent-level Auto upgrade configuration. Only takes effect when |
|
auto_upgrade
deprecated
|
boolean |
No |
[This parameter is deprecated] Use the Specifies whether to enable automatic upgrades. Valid values:
|
null |
| surge |
integer |
No |
The number of extra nodes. You can specify either this parameter or Nodes become unavailable during upgrades. You can create extra nodes to compensate for the cluster workload. Note
The number of extra nodes should not exceed the current number of nodes. |
0 |
| surge_percentage |
integer |
No |
The percentage of extra nodes. You can specify either this parameter or Number of extra nodes = Extra node percentage × Number of nodes. For example, if the extra node percentage is set to 50% and there are 6 existing nodes, the number of extra nodes = 50% × 6 = 3. |
0 |
| max_unavailable |
integer |
No |
The maximum number of unavailable nodes. Valid values: [1,1000]. Default value: 1. |
1 |
| auto_fault_diagnosis |
boolean |
No |
||
| scaling_group |
object |
No |
Node pool scaling group configuration. |
|
| vswitch_ids |
array |
Yes |
List of VSwitch IDs. Valid values: [1,8]. Note
To ensure high availability, we recommend that you select VSwitches in different zones. |
|
|
string |
No |
VSwitch ID. |
vsw-wz9mfnhmssud6eicu**** |
|
| instance_types |
array |
Yes |
List of node instance types for the node pool. When the node pool scales out nodes, it selects eligible instance types from the specified list. Supported instance type count range: [1,10]. Note
To ensure high availability, we recommend that you select multiple instance types. |
|
|
string |
No |
Instance type. For more information, see Instance families. |
ecs.d1ne.2xlarge |
|
| instance_charge_type |
string |
Yes |
Billing type of node pool nodes. Valid values:
Default value: Valid values:
|
PostPaid |
| period |
integer |
No |
Subscription duration of node pool nodes. Only takes effect and is required when
|
1 |
| period_unit |
string |
No |
Billing period unit of node pool nodes. Only takes effect and is required when
Default value: |
Month |
| auto_renew |
boolean |
No |
Whether to enable auto-renewal for node pool nodes. Only takes effect when
Default value: |
true |
| auto_renew_period |
integer |
No |
Duration for each auto-renewal cycle. Valid values:
Default value: 1. |
1 |
| spot_strategy |
string |
No |
Preemptible instance type. Valid values:
For more information, see Preemptible instances. |
NoSpot |
| spot_price_limit |
array<object> |
No |
Market price range configuration for a single preemptible instance type. |
|
|
object |
No |
Market price range configuration for preemptible instances. You can set different price ranges for different instance types. |
||
| instance_type |
string |
No |
The spot instance type. |
ecs.c6.large |
| price_limit |
string |
No |
The maximum price per instance. Unit: USD/hour.. |
0.39 |
| image_type |
string |
No |
Operating system image type. Valid values:
|
AliyunLinux3 |
| image_id |
string |
No |
Custom image ID. The system-provided image is used by default. |
aliyun_2_1903_x64_20G_alibase_20200529.vhd |
| system_disk_category |
string |
No |
Node system disk type. Valid values:
Default value: |
cloud_efficiency |
| system_disk_categories |
array |
No |
Multiple disk types for the system disk. When a higher-priority disk type is unavailable, the system automatically tries the next priority disk type to create the system disk. |
|
|
string |
No |
Multiple system disk types for nodes. Valid values:
|
cloud_essd |
|
| system_disk_size |
integer |
No |
Node system disk size. Unit: GiB. Valid values: [20,2048]. |
120 |
| system_disk_performance_level |
string |
No |
Node system disk performance. Only takes effect for ESSD disks. The disk performance level is related to the disk size. For more information, see ESSD disks.
|
PL1 |
| system_disk_encrypted |
boolean |
No |
Whether to encrypt the system disk. Valid values:
|
false |
| system_disk_kms_key_id |
string |
No |
KMS key ID used by the system disk. |
0e478b7a-4262-4802-b8cb-00d3fb40**** |
| system_disk_encrypt_algorithm |
string |
No |
Encryption algorithm used by the system disk. Valid values: aes-256. |
aes-256 |
| system_disk_bursting_enabled |
boolean |
No |
Whether to enable burst (performance bursting) for the node system disk. Valid values:
This parameter can only be set when |
true |
| system_disk_provisioned_iops |
integer |
No |
Pre-provisioned read/write IOPS for the node system disk. Possible values: 0~min{50,000, 1000*capacity-baseline performance}. Baseline performance=min{1,800+50*capacity, 50000}. This parameter can only be set when |
1000 |
| data_disks |
array |
No |
Data disk configuration for node pool nodes. |
|
| data_disk |
No |
Data disk configuration. |
||
| disk_init |
array |
No |
Block device initialization configuration. |
|
|
DiskInit |
No |
DiskInit configuration. |
||
| security_group_ids |
array |
No |
List of security group IDs. Use either this or |
|
|
string |
No |
List of security group IDs. Use either this or |
sg-wz9a8g2mt6x5ll****** |
|
| key_pair |
string |
No |
Key pair name for passwordless login. Use either this or Note
If the node pool uses ContainerOS, only |
np-key-name |
| login_password |
string |
No |
SSH login password. Use either this or |
**** |
| login_as_non_root |
boolean |
No |
Whether the provisioned ECS instances use non-root user login.
|
true |
cis_enabled
deprecated
|
boolean |
No |
[Deprecated] Use the security_hardening_os parameter instead. |
null |
| soc_enabled |
boolean |
No |
Whether to enable classified protection hardening. This can only be enabled when the system image is Alibaba Cloud Linux 2 or Alibaba Cloud Linux 3. Alibaba Cloud provides classified protection compliance baseline check standards and scanning programs for Alibaba Cloud Linux 2 and Alibaba Cloud Linux 3 Level 3 classified protection images. |
false |
| security_hardening_os |
boolean |
No |
Alibaba Cloud OS security hardening. Valid values:
Default value: |
false |
| internet_charge_type |
string |
No |
Public IP billing type. Valid values:
|
PayByTraffic |
| internet_max_bandwidth_out |
integer |
No |
Maximum outbound public bandwidth for node public IP. Unit: Mbps (Mega bit per second). Valid values: [1,100]. |
5 |
| tags |
array<object> |
No |
Add tags only to ECS instances. Tag keys cannot be duplicated and have a maximum length of 128 characters. Tag keys and tag values cannot start with "aliyun" or "acs:", or contain "https://" or "http://". |
|
|
object |
No |
Node labels. |
||
| key |
string |
No |
The tag key. |
node-k-1 |
| value |
string |
No |
The tag value. |
node-v-1 |
| desired_size |
integer |
No |
Desired node count for the node pool. The total number of nodes that the node pool should maintain. We recommend configuring at least 2 nodes to ensure cluster components run properly. You can scale the node pool out or in by adjusting the desired node count. If no nodes need to be created, set this to 0 and manually adjust later to increase the node count. |
0 |
| multi_az_policy |
string |
No |
Multi-zone scaling group ECS instance scaling policy. Valid values:
Default value: |
COST_OPTIMIZED |
| scaling_policy |
string |
No |
Scaling group mode. Valid values:
Default value: |
release |
| on_demand_base_capacity |
integer |
No |
Minimum number of pay-as-you-go instances required by the scaling group. Valid values: [0,1000]. When the number of pay-as-you-go instances is less than this value, pay-as-you-go instances are preferentially created. |
0 |
| on_demand_percentage_above_base_capacity |
integer |
No |
After the scaling group meets the minimum pay-as-you-go instance count ( |
20 |
| spot_instance_pools |
integer |
No |
Number of available instance types specified. The scaling group will evenly create preemptible instances using the lowest-cost instance types. Valid values: [1,10]. |
5 |
| spot_instance_remedy |
boolean |
No |
Whether to enable preemptible instance supplementation. When enabled, the scaling group will attempt to create new instances to replace preemptible instances that are about to be reclaimed when the reclamation notification is received. Valid values:
|
false |
| compensate_with_on_demand |
boolean |
No |
When
|
true |
| deploymentset_id |
string |
No |
Deployment set ID. You can use a deployment set to distribute ECS instances created by the node pool across different physical servers to ensure business high availability and underlying disaster recovery capabilities. When creating ECS instances within a deployment set, the instances are distributed across the specified region based on the pre-configured deployment strategy. Important After selecting a deployment set, the maximum number of nodes in the node pool will be limited. The default node limit supported by a deployment set is 20 * number of zones (the number of zones is determined by the VSwitches). Choose carefully to ensure sufficient quota within the deployment set to avoid node provisioning failures. |
ds-bp1d19mmbsv3jf6xxxxx |
| rds_instances |
array |
No |
List of RDS instances. |
|
|
string |
No |
RDS instance ID. |
rds-**** |
|
| private_pool_options |
object |
No |
Private pool configuration. |
|
| id |
string |
No |
The private pool ID. When |
eap-bp67acfmxazb4**** |
| match_criteria |
string |
No |
The private pool type. Specifies the capacity option for the private pool used to launch instances. After an elasticity assurance or capacity reservation takes effect, a private pool is generated for instance launches. Valid values:
|
Target |
security_group_id
deprecated
|
string |
No |
Node pool security group ID. Use either this or |
sg-wz9a8g2mt6x5llu0**** |
platform
deprecated
|
string |
No |
[Deprecated] Use the Operating system distribution. Valid values:
Default value: |
null |
| instance_patterns |
array |
No |
Instance attribute configuration. |
|
| instance_patterns |
No |
Instance attributes. |
||
| ram_role_name |
string |
No |
Worker RAM role name.
Important This parameter is only supported for ACK managed clusters of version 1.22 and later. |
example-role |
| instance_metadata_options | InstanceMetadataOptions |
No |
ECS instance metadata access configuration. |
|
| resource_pool_options |
object |
No |
Resource pool and resource pool strategy used when creating instances. Note the following when setting this parameter: This parameter only takes effect when creating pay-as-you-go instances. This parameter cannot be set simultaneously with private_pool_options.match_criteria or private_pool_options.id. |
|
| strategy |
string |
No |
The resource pool policy used when creating instances. Resource pools include private pools generated by elasticity assurance or capacity reservation services and public pools. Valid values: PrivatePoolFirst: private pool first. When this policy is selected and resouce_pool_options.private_pool_ids is specified, the specified private pools are used first. If no private pools are specified or the specified private pool capacity is insufficient, open-type private pools are automatically matched. If no matching private pools are available, public pool resources are used to create instances. PrivatePoolOnly: private pool only. When this policy is selected, you must specify resouce_pool_options.private_pool_ids. If the specified private pool capacity is insufficient, the instance fails to launch. None: no resource pool policy is used. Default value: None. |
PrivatePoolFirst |
| private_pool_ids |
array |
No |
The list of private pool IDs, which are elasticity assurance IDs or capacity reservation IDs. Only Target-mode private pool IDs can be specified. Valid values of N: 1 to 20. |
|
|
string |
No |
The private pool ID, which is an elasticity assurance ID or capacity reservation ID. Only Target-mode private pool IDs can be specified. |
eap-bp67acfmxazb4**** |
|
| system_disk_snapshot_policy_id |
string |
No |
System disk snapshot policy. |
sp-0jl6xnmme8v7o935**** |
| node_config |
object |
No |
Node configuration. |
|
| kubelet_configuration | kubelet_config |
No |
Kubelet parameter configuration. |
|
| kubernetes_config |
object |
No |
Cluster-related configuration. |
|
| labels |
array |
No |
Node labels. Add labels to Kubernetes cluster nodes. |
|
| tag |
No |
Label configuration. |
||
| taints |
array |
No |
Taint configuration. |
|
| taint |
No |
Collection of taint configurations. |
||
| runtime |
string |
No |
Container runtime name. ACK supports the following three container runtimes:
Default value: containerd. |
containerd |
| runtime_version |
string |
No |
Container runtime version. |
1.6.38 |
| cpu_policy |
string |
No |
Node CPU management policy. The following two policies are supported for cluster versions 1.12.6 and later:
Default value: |
none |
| user_data |
string |
No |
Instance custom data. After the node joins the cluster, the specified instance custom data script will be executed. For more information, see User-Data scripts. |
dGhpcyBpcyBhIGV4YW1wbGU= |
| unschedulable |
boolean |
No |
Whether nodes after scale-out are unschedulable.
|
true |
| cms_enabled |
boolean |
No |
Whether to install CloudMonitor on ECS nodes. After installation, you can view monitoring information of the created ECS instances in the CloudMonitor console. We recommend enabling this. Valid values:
Default value: |
false |
| node_name_mode |
string |
No |
Custom node name. After customizing the node name, the node name, ECS instance name, and ECS instance hostname will all be changed. Note
For Windows instances with custom node names enabled, the hostname is fixed to the IP address with - replacing . in the IP address, without prefix or suffix. The node name consists of three parts: prefix, node IP address, and 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 |
Instance pre-custom data. Before the node joins the cluster, the specified instance pre-custom data script will be executed. For more information, see User-Data scripts. |
dGhpcyBpcyBhIGV4YW1wbGU |
| tee_config |
object |
No |
Trusted execution environment (TEE) cluster configuration. |
|
| tee_enable |
boolean |
No |
Whether to enable TEE cluster.
|
true |
interconnect_config
deprecated
|
object |
No |
[Deprecated] Edge node pool configuration. |
|
| cen_id |
string |
No |
[Deprecated] Cloud Enterprise Network (CEN) instance ID bound to the enhanced edge node pool (CENID). |
null |
| ccn_id |
string |
No |
[Deprecated] Cloud Connect Network (CCN) instance ID bound to the enhanced edge node pool (CCNID). |
null |
| ccn_region_id |
string |
No |
[Deprecated] Region of the Cloud Connect Network (CCN) instance bound to the enhanced edge node pool. |
null |
| bandwidth |
integer |
No |
[Deprecated] Network bandwidth of the enhanced edge node pool. Unit: Mbps. |
null |
| improved_period |
string |
No |
[Deprecated] Purchase duration of the enhanced edge node pool. Unit: months. |
null |
count
deprecated
|
integer |
No |
[Deprecated] Use desired_size instead. Number of nodes in the node pool. |
null |
max_nodes
deprecated
|
integer |
No |
[Deprecated] Maximum number of nodes allowed in the edge node pool. |
null |
| interconnect_mode |
string |
No |
Network type of the edge node pool. This parameter only takes effect for
|
basic |
| host_network |
boolean |
No |
Whether the Pod network mode uses host network mode.
|
true |
| intranet |
boolean |
No |
Whether nodes in the edge node pool are interconnected at Layer 3.
|
true |
| eflo_node_group |
object |
No |
Lingjun node pool configuration. |
|
| cluster_id |
string |
No |
Lingjun cluster ID to associate when creating a Lingjun node pool. |
i1169130516633730**** |
| group_id |
string |
No |
Lingjun group ID of the Lingjun cluster to associate when creating a Lingjun node pool. |
ng-ec3c96ff0aa**** |
| auto_mode |
object |
No |
Node pool intelligent managed configuration. |
|
| enable |
boolean |
No |
Whether to enable intelligent managed mode. Valid values:
|
true |
| node_components |
array<object> |
No |
List of node components. |
|
|
array<object> |
No |
Node component. |
||
| name |
string |
No |
Node component name. |
kubelet |
| version |
string |
No |
Node component version. |
1.33.3-aliyun.1 |
| config |
object |
No |
Node component configuration. |
|
| custom_config |
object |
No |
The custom configuration of the node component. |
{"cpuManagerPolicy":"static"} |
|
string |
No |
Custom configuration string for the node component. |
cpuManagerPolicy |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Node pool configuration. |
||
| nodepool_id |
string |
Node pool ID. |
np31da1b38983f4511b490fc62108a**** |
| task_id |
string |
Task ID. |
T-613b19bbd160ad492800**** |
| request_id |
string |
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.