A node pool is a logical collection of nodes that share the same attributes. Node pools allow unified management and O&M of nodes, such as node upgrades and elastic scaling. You can further use 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 |
The cluster ID. |
c61da77e8bfbc4c4c999af2b51b65**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body parameters. |
|
| nodepool_info |
object |
No |
The node pool configuration. |
|
| name |
string |
Yes |
The node pool name. |
nodepool-test |
| type |
string |
No |
The node pool type. Valid values:
Valid values:
|
ess |
| resource_group_id |
string |
No |
The resource group ID of the node pool. Instances scaled out by 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 different business scenarios. |
rg-acfmyvw3wjmb**** |
| auto_scaling |
object |
No |
The elastic scaling configuration. |
|
| enable |
boolean |
No |
Specifies whether to enable auto scaling. Valid values:
When the value is false, other configuration parameters in Default value: |
false |
| type |
string |
No |
The instance type for elastic scaling. This parameter takes effect only when
Default value: Important This parameter cannot be modified after the node pool is created. Valid values:
|
cpu |
| max_instances |
integer |
No |
The maximum number of scalable instances in the node pool, excluding your existing instances. This parameter takes effect only when Valid values: [min_instances, 2000]. Default value: 0. |
10 |
| min_instances |
integer |
No |
The minimum number of scalable instances in the node pool, excluding your existing instances. This parameter takes effect only when Valid values: [0, max_instances]. Default value: 0. Note
|
1 |
is_bond_eip
deprecated
|
boolean |
No |
[Deprecated] This parameter is deprecated. Use internet_charge_type and internet_max_bandwidth_out instead. Specifies whether to associate 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. The billing method of the EIP. Valid values:
Default value: |
null |
eip_bandwidth
deprecated
|
integer |
No |
[Deprecated] Use internet_charge_type and internet_max_bandwidth_out instead. The peak bandwidth of the EIP. Unit: Mbit/s. |
null |
| management |
object |
No |
The configuration 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 automatically repair nodes. This parameter takes effect only when
Default value: |
true |
| auto_repair_policy |
object |
No |
The automatic node repair 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. |
|
| max_parallel_repairing_nodes |
string |
No |
The maximum number of nodes that can be repaired in parallel. When a large number of unhealthy nodes exist in the node pool, this parameter specifies the maximum number or percentage of nodes that can be repaired simultaneously. You can specify a number (such as 5, valid range: 1 to 100000) or a percentage (such as 10%, valid range: 1% to 100%). Default value: 1. |
5 |
| max_unhealthy_nodes_threshold |
string |
No |
The self-healing circuit breaker threshold. When the number or percentage of faulty nodes exceeds this threshold, self-healing enters a circuit breaker state and stops initiating new repair actions. You can specify a number (such as 10, valid range: 1 to 100000) or a percentage (such as 20%, valid range: 1% to 100%). Default value: 100%. |
20% |
| auto_vul_fix |
boolean |
No |
Specifies whether to automatically fix CVE vulnerabilities. This parameter takes effect only when
Default value: |
true |
| auto_vul_fix_policy |
object |
No |
The automatic 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 |
Specifies whether to automatically upgrade nodes. This parameter takes effect only when
Default value: |
true |
| auto_upgrade_policy |
object |
No |
The automatic node upgrade 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 The automatic upgrade configuration. This parameter takes effect only when |
|
auto_upgrade
deprecated
|
boolean |
No |
[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 load. 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 = percentage of extra nodes × number of nodes. For example, if the percentage of extra nodes 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 range: [1,1000] Default value: 1. |
1 |
| auto_fault_diagnosis |
boolean |
No |
Specifies whether to enable ECS fault detection for node self-healing. |
|
| drift_enabled |
boolean |
No |
Specifies whether to enable node rotation. Only intelligent managed node pools support this feature, and it is enabled by default. Common node pools do not support this feature. |
|
| scaling_group |
object |
No |
The scaling group configuration of the node pool. |
|
| vswitch_ids |
array |
Yes |
The list of vSwitch IDs. Valid values: [1,8]. Note
To ensure high availability, select vSwitches in different zones. |
|
|
string |
No |
The vSwitch ID. |
vsw-wz9mfnhmssud6eicu**** |
|
| instance_types |
array |
Yes |
The list of instance types for the node pool. When the node pool scales out, instances are created based on the instance types that meet the requirements from this list. The number of supported instance types ranges from 1 to 10. Note
To ensure high availability, 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 nodes in the node pool. Valid values:
Default value: Valid values:
|
PostPaid |
| period |
integer |
No |
The subscription duration of nodes in the node pool. This parameter takes effect and is required only when
|
1 |
| period_unit |
string |
No |
The compute unit (CU) of the subscription epoch for nodes in the node pool. This parameter takes effect and is required only when
Default value: |
Month |
| auto_renew |
boolean |
No |
Specifies whether to enable auto-renewal for nodes in the node pool. This parameter takes effect only when
Default value: |
true |
| auto_renew_period |
integer |
No |
The auto-renewal duration for a single renewal. Valid values:
Default value: 1. |
1 |
| spot_strategy |
string |
No |
The type of spot instance. Valid values:
For more information, see Spot instances. |
NoSpot |
| spot_price_limit |
array<object> |
No |
The price range configuration for a single spot instance type. |
|
|
object |
No |
The price range configuration for spot instances. 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 price per instance. Unit: USD/hour. |
0.39 |
| image_type |
string |
No |
The type of operating system image. Valid values:
|
AliyunLinux3 |
| image_id |
string |
No |
The custom image ID. The system-provided image is used by default. |
aliyun_2_1903_x64_20G_alibase_20200529.vhd |
| system_disk_category |
string |
No |
The type of the system cloud disk for nodes. Valid values:
Default value: |
cloud_efficiency |
| system_disk_categories |
array |
No |
Multiple cloud disk types for the system cloud disk. If the highest-priority cloud disk type is unavailable, the system automatically attempts the next-priority cloud disk type to create the system cloud disk. |
|
|
string |
No |
Multiple system cloud disk types for nodes. Valid values:
|
cloud_essd |
|
| system_disk_size |
integer |
No |
The size of the system cloud disk for nodes. Unit: GiB. Valid values: [20,2048]. |
120 |
| system_disk_performance_level |
string |
No |
The performance level of the system cloud disk for nodes. This parameter takes effect only for ESSD cloud disks. The performance level varies based on the cloud disk size. For more information, see ESSD cloud disks.
|
PL1 |
| system_disk_encrypted |
boolean |
No |
Specifies whether to encrypt the system cloud disk. Valid values:
|
false |
| system_disk_kms_key_id |
string |
No |
The KMS key ID used by the system cloud disk. |
0e478b7a-4262-4802-b8cb-00d3fb40**** |
| system_disk_encrypt_algorithm |
string |
No |
The encryption algorithm used by the system cloud disk. Valid values: aes-256. |
aes-256 |
| system_disk_bursting_enabled |
boolean |
No |
Specifies whether to enable burst (performance burst) for the node system cloud disk. Valid values:
This parameter is supported only when |
true |
| system_disk_provisioned_iops |
integer |
No |
The provisioned read/write IOPS of the node system cloud disk. Valid values: 0~min{50,000, 1000*capacity-baseline performance}. Baseline performance=min{1,800+50*capacity, 50000}. This parameter is supported only when |
1000 |
| data_disks |
array |
No |
The data cloud disk configuration for nodes in the node pool. |
|
| data_disk |
No |
The data cloud disk configuration. |
||
| security_group_ids |
array |
No |
The list of security group IDs. This parameter is mutually exclusive with |
|
|
string |
No |
The list of security group IDs. This parameter is mutually exclusive with |
sg-wz9a8g2mt6x5ll****** |
|
| key_pair |
string |
No |
The name of the key pair for password-free logon. This parameter is mutually exclusive with Note
If the node pool uses the ContainerOS operating system, only |
np-key-name |
| login_password |
string |
No |
The SSH logon password. This parameter is mutually exclusive with |
**** |
| login_as_non_root |
boolean |
No |
Specifies whether to log on to the scaled-out ECS instance 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. This parameter is available only 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 MLPS 2.0 Level 3 images. |
false |
| security_hardening_os |
boolean |
No |
Specifies whether to enable Alibaba Cloud OS security hardening. Valid values:
Default value: |
false |
| internet_charge_type |
string |
No |
The billing method for public IP addresses. Valid values:
|
PayByTraffic |
| internet_max_bandwidth_out |
integer |
No |
The maximum outbound public bandwidth for nodes. Unit: Mbit/s. Valid values: [1,100]. |
5 |
| tags |
array<object> |
No |
Tags that are added only to ECS instances. Tag keys cannot be duplicated and can be up to 128 characters in length. Tag keys and tag values cannot start with "aliyun" or "acs:", or contain "https://" or "http://". |
|
|
object |
No |
The node tag. |
||
| key |
string |
No |
The tag key. |
node-k-1 |
| value |
string |
No |
The tag value. |
node-v-1 |
| desired_size |
integer |
No |
The desired 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 2 nodes to ensure that cluster components run properly. You can scale the node pool in or out by adjusting the desired number of nodes. If you do not need to create nodes, set this parameter to 0. You can manually adjust the value later to add nodes. |
0 |
| multi_az_policy |
string |
No |
The multi-zone scaling policy for ECS instances in the scaling group. Valid values:
Default value: |
COST_OPTIMIZED |
| scaling_policy |
string |
No |
The scaling group mode. Valid values:
Default value: |
release |
| on_demand_base_capacity |
integer |
No |
The minimum number of pay-as-you-go instances required in 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 created first. |
0 |
| on_demand_percentage_above_base_capacity |
integer |
No |
The percentage of pay-as-you-go instances among the extra instances that exceed the minimum number of pay-as-you-go instances ( |
20 |
| spot_instance_pools |
integer |
No |
The number of available instance types. The scaling group creates spot instances of multiple types at the lowest cost. Valid values: [1,10]. |
5 |
| spot_instance_remedy |
boolean |
No |
Specifies whether to enable the supplementation of spot instances. If this feature is enabled, the scaling group attempts to create new instances to replace spot instances that are about to be reclaimed when it receives a system message indicating the reclamation. Valid values:
|
false |
| compensate_with_on_demand |
boolean |
No |
Specifies whether to allow the automatic creation of pay-as-you-go instances to meet the required number of ECS instances when
|
true |
| enable_high_density_mode |
boolean |
No |
Specifies whether to enable high-density cloud disk mode. This mode is supported only when the node pool uses instance types. When enabled, the total number of system cloud disks and data cloud disks does not exceed the maximum number of high-density cloud disks supported by the instance type. |
false |
| deploymentset_id |
string |
No |
The deployment set ID. You can use a deployment set to distribute ECS instances scaled out by the node pool across different physical servers to ensure high availability and underlying disaster recovery. When ECS instances are created within a deployment set, they are launched in the specified region based on the preconfigured deployment strategy. Important After you select a deployment set, the maximum number of nodes in the node pool is limited. The default maximum number of nodes supported by a deployment set is 20 × the number of zones (the number of zones is determined by the vSwitches). Select a deployment set carefully and ensure that the deployment set has sufficient quota to avoid node scale-out failures. |
ds-bp1d19mmbsv3jf6xxxxx |
| rds_instances |
array |
No |
The list of ApsaraDB RDS instances. |
|
|
string |
No |
The ApsaraDB RDS instance ID. |
rds-**** |
|
| private_pool_options |
object |
No |
The private node pool configuration. |
|
| id |
string |
No |
The private node pool ID. When |
eap-bp67acfmxazb4**** |
| match_criteria |
string |
No |
The private node 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 |
The security group ID of the node pool. Use either this parameter or |
sg-wz9a8g2mt6x5llu0**** |
platform
deprecated
|
string |
No |
[Deprecated] Use the The operating system distribution. Valid values:
Default value: |
null |
| instance_patterns |
array |
No |
The instance attribute configuration. |
|
| instance_patterns |
No |
The instance attributes. |
||
| ram_role_name |
string |
No |
The worker RAM role name.
Important Only ACK managed clusters of version 1.22 or later support this parameter. |
example-role |
| instance_metadata_options | InstanceMetadataOptions |
No |
The ECS instance metadata access configuration. |
|
| resource_pool_options |
object |
No |
The resource pool and resource pool policy used when creating instances. Note the following when you set this parameter: This parameter takes effect only when creating pay-as-you-go instances. This parameter cannot be set together 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 after an elasticity assurance or capacity reservation takes effect, and public pools, which are available for instance launches. 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 pool is specified or the specified private pool has insufficient capacity, open private pools are automatically matched. If no matching private pool is available, public pool resources are used to create instances. PrivatePoolOnly: private pool only. When this policy is selected, resouce_pool_options.private_pool_ids must be specified. If the specified private pool has insufficient capacity, instance launch fails. None: no resource pool policy. 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 the 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 |
The snapshot policy for the system cloud disk. |
sp-0jl6xnmme8v7o935**** |
| disk_init |
array |
No |
The block device initialization configuration. |
|
|
DiskInit |
No |
The DiskInit configuration. |
||
| cpu_options |
object |
No |
The CPU-related configuration options. |
|
| nested_virtualization |
string |
No |
Specifies whether to enable nested virtualization. Valid values: disabled: disables nested virtualization. enabled: enables nested virtualization. |
enabled |
| node_config |
object |
No |
The node configuration. |
|
| kubelet_configuration | kubelet_config |
No |
The kubelet parameter settings. |
|
| kubernetes_config |
object |
No |
The cluster-related configuration. |
|
| labels |
array |
No |
The node labels. You can add labels to nodes in the Kubernetes cluster. |
|
| tag |
No |
The label configuration. |
||
| taints |
array |
No |
The taint configuration. |
|
| taint |
No |
The collection of taint configurations. |
||
| runtime |
string |
No |
The container runtime name. ACK supports the following three container runtimes:
Default value: containerd. |
containerd |
| runtime_version |
string |
No |
The container runtime version. |
1.6.38 |
| cpu_policy |
string |
No |
The CPU management policy for nodes. The following two policies are supported for clusters of version 1.12.6 and 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 nodes are unschedulable after scale-out.
|
true |
| cms_enabled |
boolean |
No |
Specifies whether to install the CloudMonitor agent on ECS nodes. After installation, you can view monitoring information about the created ECS instances in the CloudMonitor console. We recommend that you enable this feature. Valid values:
Default value: |
false |
| node_name_mode |
string |
No |
The custom node name. After you customize the node name, the node name, ECS instance name, and ECS instance hostname are all changed. Note
For Windows instances with custom node names enabled, the hostname is fixed to the IP address with hyphens (-) replacing the dots (.) in the IP address, and does not include the prefix or suffix. The node name consists of three parts: prefix, node IP address, and suffix.
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-user data for the instance. Before the node joins the cluster, the specified pre-user data script is run. For more information, see User data scripts. |
dGhpcyBpcyBhIGV4YW1wbGU |
| tee_config |
object |
No |
The confidential computing cluster configuration. |
|
| tee_enable |
boolean |
No |
Specifies whether to enable confidential computing for the cluster.
|
true |
interconnect_config
deprecated
|
object |
No |
[Deprecated] The edge node pool configuration. |
|
| cen_id |
string |
No |
[Deprecated] The Cloud Enterprise Network (CEN) instance ID bound to the enhanced edge node pool. |
null |
| ccn_id |
string |
No |
[Deprecated] The Cloud Connect Network (CCN) instance ID bound to the enhanced edge node pool. |
null |
| ccn_region_id |
string |
No |
[Deprecated] The region of the Cloud Connect Network (CCN) instance bound to the enhanced edge node pool. |
null |
| bandwidth |
integer |
No |
[Deprecated] The network bandwidth of the enhanced edge node pool. Unit: Mbps. |
null |
| improved_period |
string |
No |
[Deprecated] The purchase duration of the enhanced edge node pool. Unit: months. |
null |
count
deprecated
|
integer |
No |
[Deprecated] Use desired_size instead. The number of nodes in the node pool. |
null |
max_nodes
deprecated
|
integer |
No |
[Deprecated] The maximum number of nodes allowed in the edge node pool. |
null |
| interconnect_mode |
string |
No |
The network type of the edge node pool. This parameter takes effect only for node pools with
|
basic |
| host_network |
boolean |
No |
Specifies whether the pod network mode uses host network mode.
|
true |
| intranet |
boolean |
No |
Specifies whether nodes in the edge node pool have Layer 3 network connectivity with each other.
|
true |
| eflo_node_group |
object |
No |
The Lingjun node pool configuration. |
|
| cluster_id |
string |
No |
The Lingjun cluster ID to associate when creating a Lingjun node pool. |
i1169130516633730**** |
| group_id |
string |
No |
The Lingjun group ID of the Lingjun cluster to associate when creating a Lingjun node pool. |
ng-ec3c96ff0aa**** |
| auto_attach_enabled |
boolean |
No |
Specifies whether to enable automatic node addition for the Lingjun node pool. |
|
| worker_ram_role_name |
string |
No |
The Worker RAM role used by the Lingjun node pool. |
|
| auto_mode |
object |
No |
The intelligent managed configuration for the node pool. |
|
| enable |
boolean |
No |
Specifies whether to enable intelligent managed mode. Valid values:
|
true |
| node_components |
array<object> |
No |
The 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 configuration of the node component. |
|
| custom_config |
object |
No |
The custom configuration of the node component. |
{"cpuManagerPolicy":"static"} |
|
any |
No |
The custom configuration string of the node component. |
cpuManagerPolicy |
|
| envs |
array<object> |
No |
The environment variables of the node component. |
|
|
object |
No |
|||
| name |
string |
No |
The name of the environment variable. |
LOG_LEVEL |
| value |
string |
No |
The value of the environment variable. |
info |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The node pool configuration. |
||
| 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.