A node pool is a logical collection 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 to use features such as automatic OS CVE vulnerability patching, automatic faulty node recovery, and automatic kubelet and containerd version upgrades, reducing 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. Based on different 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 this parameter is set to false, other configuration parameters in Default value: |
false |
| type |
string |
No |
Auto scaling instance type. Takes effect only 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 instances that can be scaled in the node pool, excluding existing instances. Takes effect only when Valid values: [min_instances, 2000]. Default value: 0. |
10 |
| min_instances |
integer |
No |
Minimum number of instances that can be scaled in the node pool, excluding existing instances. Takes effect only 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 method. Valid values:
Default value: |
null |
eip_bandwidth
deprecated
|
integer |
No |
[Deprecated] Use internet_charge_type and internet_max_bandwidth_out instead. Maximum EIP bandwidth. Unit: Mbps. |
null |
| management |
object |
No |
Node pool managed feature configuration. |
|
| enable |
boolean |
No |
Whether to enable the managed feature for the node pool. Valid values:
Default value: false. |
false |
| auto_repair |
boolean |
No |
Whether to automatically repair nodes. Takes effect only 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. Takes effect only 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 fixing, separated by commas. Example:
Default value: |
asap,nntf |
| exclude_packages |
string |
No |
The packages to exclude during vulnerability fixing. Default value: |
kernel |
| auto_upgrade |
boolean |
No |
Whether to automatically upgrade nodes. Takes effect only when
Default value: |
true |
| auto_upgrade_policy |
object |
No |
Auto 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 Auto upgrade configuration. 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 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, instance types that meet the requirements are selected from the specified list to create instances. Supported number of instance types: [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 method for nodes in the node pool. Valid values:
Default value: Valid values:
|
PostPaid |
| period |
integer |
No |
Subscription duration for nodes in the node pool. Takes effect and is required only when
|
1 |
| period_unit |
string |
No |
Billing period unit for nodes in the node pool. Takes effect and is required only when
Default value: |
Month |
| auto_renew |
boolean |
No |
Whether to enable auto-renewal for nodes in the node pool. Takes effect only when
Default value: |
true |
| auto_renew_period |
integer |
No |
Duration of each auto-renewal. 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 |
OS 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 next-priority disk type is automatically used 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 level. Only applicable to ESSD disks. The performance level is related to disk size. For more information, see ESSDs.
|
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 is supported only when |
true |
| system_disk_provisioned_iops |
integer |
No |
Pre-configured read/write IOPS for the node system disk. Valid values: 0 to 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 |
Data disk configuration for nodes in the node pool. |
|
| 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. Mutually exclusive with |
|
|
string |
No |
List of security group IDs. Mutually exclusive with |
sg-wz9a8g2mt6x5ll****** |
|
| key_pair |
string |
No |
Key pair name for passwordless login. Mutually exclusive with Note
If the node pool uses the ContainerOS operating system, only |
np-key-name |
| login_password |
string |
No |
SSH login password. Mutually exclusive with |
**** |
| login_as_non_root |
boolean |
No |
Whether the created ECS instances use a non-root user for login.
|
true |
cis_enabled
deprecated
|
boolean |
No |
[Deprecated] Use the security_hardening_os parameter instead. |
null |
| soc_enabled |
boolean |
No |
Whether to enable China classified protection of cybersecurity (China MLPS) hardening. China MLPS hardening can be enabled for nodes only when the system image is set to Alibaba Cloud Linux 2 or Alibaba Cloud Linux 3. Alibaba Cloud provides China MLPS 2.0 Level III baseline check standards and scanning programs for Alibaba Cloud Linux 2 and Alibaba Cloud Linux 3 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 method. Valid values:
|
PayByTraffic |
| internet_max_bandwidth_out |
integer |
No |
Maximum outbound public bandwidth for nodes. Unit: Mbps (Megabits per second). Valid values: [1,100]. |
5 |
| tags |
array<object> |
No |
Tags 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 |
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 number of nodes in the node pool. The total number of nodes that the node pool should maintain. We recommend configuring at least 2 nodes to ensure proper running of cluster components. You can scale in or out the node pool by adjusting the desired node count. If no nodes need to be created, set this to 0 and manually adjust the node count later. |
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 created first. |
0 |
| on_demand_percentage_above_base_capacity |
integer |
No |
Percentage of pay-as-you-go instances among the excess instances after the scaling group meets the minimum pay-as-you-go instance requirement ( |
20 |
| spot_instance_pools |
integer |
No |
Number of available instance types. The scaling group creates preemptible instances in a balanced manner among the lowest-cost instance types. Valid values: [1,10]. |
5 |
| spot_instance_remedy |
boolean |
No |
Whether to enable supplementing preemptible instances. When enabled, the scaling group attempts to create new instances to replace preemptible instances that are about to be reclaimed. 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 high availability and disaster recovery capabilities. When creating ECS instances in a deployment set, instances are distributed across the specified region based on the pre-configured deployment policy. Important After a deployment set is selected, the maximum number of nodes in the node pool is limited. The default upper limit for nodes in a deployment set is 20 × number of zones (the number of zones is determined by vSwitches). Choose carefully and ensure sufficient quota in the deployment set to avoid node creation failures. |
ds-bp1d19mmbsv3jf6xxxxx |
| rds_instances |
array |
No |
RDS instance list. |
|
|
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 type of the private pool. This parameter specifies the private pool capacity option for instance launch. After an elasticity assurance or capacity reservation takes effect, a private pool is generated for instances to use during launch. Valid values:
|
Target |
security_group_id
deprecated
|
string |
No |
Security group ID for the node pool. Mutually exclusive with |
sg-wz9a8g2mt6x5llu0**** |
platform
deprecated
|
string |
No |
[Deprecated] Use the OS 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 supported only for ACK managed clusters of version 1.22 or later. |
example-role |
| instance_metadata_options | InstanceMetadataOptions |
No |
ECS instance metadata access configuration. |
|
| resource_pool_options |
object |
No |
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 by elasticity assurance or capacity reservation services and public pools, which are available for instance launch. 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, resouce_pool_options.private_pool_ids must be specified. 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 |
Taint configuration collection. |
||
| 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 when the cluster version is 1.12.6 or later:
Default value: |
none |
| user_data |
string |
No |
Instance custom data. After a node joins the cluster, the specified instance custom data script is run. For more information, see User-Data scripts. |
dGhpcyBpcyBhIGV4YW1wbGU= |
| unschedulable |
boolean |
No |
Whether scaled-out nodes are unschedulable.
|
true |
| cms_enabled |
boolean |
No |
Whether to install CloudMonitor on ECS nodes. After installation, you can view monitoring information for 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 setting a custom node name, the node name, ECS instance name, and ECS instance hostname are all changed accordingly. Note
For Windows instances with custom node names enabled, the hostname is fixed to the IP address with "-" replacing "." in the IP address, and does not include the prefix or suffix. A 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 |
Instance pre-custom data. Before a node joins the cluster, the specified instance pre-custom data script is run. For more information, see User-Data scripts. |
dGhpcyBpcyBhIGV4YW1wbGU |
| tee_config |
object |
No |
Confidential computing cluster configuration. |
|
| tee_enable |
boolean |
No |
Whether to enable confidential computing for the cluster.
|
true |
interconnect_config
deprecated
|
object |
No |
[Deprecated] Edge node pool configuration. |
|
| cen_id |
string |
No |
[Deprecated] CEN instance ID (CEN ID) bound to the enhanced edge node pool. |
null |
| ccn_id |
string |
No |
[Deprecated] CCN instance ID (CCN ID) bound to the enhanced edge node pool. |
null |
| ccn_region_id |
string |
No |
[Deprecated] Region of the 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] Subscription 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 takes effect only for node pools of
|
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 have Layer 3 network connectivity.
|
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 |
Node component list. |
|
|
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 |
节点组件自定义配置。 |
{"cpuManagerPolicy":"static"} |
|
any |
No |
节点组件自定义配置字符串。 |
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.