A node pool is a logical collection of nodes that share the same attributes, allowing unified management and operations 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 your business scenarios. |
rg-acfmyvw3wjmb**** |
| auto_scaling |
object |
No |
The automatic elastic scaling configuration. |
|
| enable |
boolean |
No |
Specifies whether to enable automatic scaling. Valid values:
When the value is false, other configuration parameters in Default value: |
false |
| type |
string |
No |
The instance type for automatic elastic scaling. This parameter 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 |
The maximum number of instances that can be scaled 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 instances that can be scaled 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 field is deprecated. Use internet_charge_type and internet_max_bandwidth_out instead. Specifies whether to associate an elastic IP address (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 managed feature configuration for the node pool. |
|
| enable |
boolean |
No |
Specifies whether to enable the managed feature for the node pool. 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 auto repair node policy. |
|
| restart_node |
boolean |
No |
Whether to allow node restart. Takes effect only when
Default value: |
true |
| approval_required |
boolean |
No |
Whether node repair requires manual approval. |
|
| 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 auto CVE fix policy. |
|
| restart_node |
boolean |
No |
Whether to allow node restart. Takes effect only when
Default value: |
false |
| vul_level |
string |
No |
Vulnerability levels allowed for automatic fixing, separated by commas, for example:
Default value: |
asap,nntf |
| exclude_packages |
string |
No |
Packages to exclude during vulnerability patching. 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 auto upgrade node policy. |
|
| auto_upgrade_kubelet |
boolean |
No |
Whether to allow automatic kubelet upgrade. Takes effect only when
Default value: |
true |
| auto_upgrade_runtime |
boolean |
No |
Whether to allow automatic runtime upgrade. Takes effect only when
Default value: |
false |
| auto_upgrade_os |
boolean |
No |
Whether to allow automatic OS upgrade. 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 Whether to enable auto upgrade. Valid values:
|
null |
| surge |
integer |
No |
Number of extra nodes. Mutually exclusive with Nodes become unavailable during upgrade. You can create extra nodes to compensate for the cluster workload. Note
It is recommended that the number of extra nodes does not exceed the current number of nodes. |
0 |
| surge_percentage |
integer |
No |
Percentage of extra nodes. Mutually exclusive with Number of extra nodes = percentage of extra nodes × number of nodes. For example, if the percentage is set to 50% and there are 6 existing nodes, the number of extra nodes = 50% × 6 = 3. |
0 |
| max_unavailable |
integer |
No |
Maximum number of unavailable nodes. Valid values: [1,1000] Default value: 1. |
1 |
| auto_fault_diagnosis |
boolean |
No |
||
| scaling_group |
object |
No |
The scaling group configuration for 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 nodes, it selects eligible instance types from this list to create instances. 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 billing period unit of 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 cycle. Valid values:
Default value: 1. |
1 |
| spot_strategy |
string |
No |
The bidding policy for spot instances. Valid values:
For more information, see Spot instances. |
NoSpot |
| spot_price_limit |
array<object> |
No |
The market price range configuration for a single spot instance type. |
|
|
object |
No |
The market price range configuration for spot instances. You can set different price ranges for different instance types. |
||
| instance_type |
string |
No |
Preemptible instance type. |
ecs.c6.large |
| price_limit |
string |
No |
Maximum price per instance. Unit: USD/hour. |
0.39 |
| image_type |
string |
No |
The operating system image type. 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 node system cloud disk. Valid values:
Default value: |
cloud_efficiency |
| system_disk_categories |
array |
No |
Multiple system cloud disk types. When a higher-priority cloud disk type is unavailable, the system automatically tries the next-priority cloud disk type to create the system cloud disk. |
|
|
string |
No |
The multiple system cloud disk types for nodes. Valid values:
|
cloud_essd |
|
| system_disk_size |
integer |
No |
The size of the node system cloud disk. Unit: GiB. Valid values: [20,2048]. |
120 |
| system_disk_performance_level |
string |
No |
The performance level of the node system cloud disk. 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 for the system cloud disk. |
0e478b7a-4262-4802-b8cb-00d3fb40**** |
| system_disk_encrypt_algorithm |
string |
No |
The encryption algorithm for 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 for the node system cloud 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 |
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. Specify either this parameter or |
|
|
string |
No |
The list of security group IDs. Specify either this parameter or |
sg-wz9a8g2mt6x5ll****** |
|
| key_pair |
string |
No |
The name of the key pair for password-free logon. Specify either this parameter or Note
If the node pool uses the ContainerOS operating system, only |
np-key-name |
| login_password |
string |
No |
The SSH logon password. Specify either this parameter or |
**** |
| login_as_non_root |
boolean |
No |
Specifies whether scaled-out ECS instances use non-root logon.
|
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 feature 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 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 |
Tag key. |
node-k-1 |
| value |
string |
No |
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 node count. If you do not need to create nodes, set this parameter to 0 and manually adjust the value later to add nodes. |
0 |
| multi_az_policy |
string |
No |
The scaling policy for ECS instances in a multi-zone 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]. Pay-as-you-go instances are created first when the number of pay-as-you-go instances is less than this value. |
0 |
| on_demand_percentage_above_base_capacity |
integer |
No |
The percentage of pay-as-you-go instances among the excess instances after 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 across the lowest-cost instance types in a balanced manner. Valid values: [1,10]. |
5 |
| spot_instance_remedy |
boolean |
No |
Specifies whether to enable supplementing spot instances. When enabled, the scaling group attempts to create new instances to replace spot instances that are about to be reclaimed. Valid values:
|
false |
| compensate_with_on_demand |
boolean |
No |
When
|
true |
| 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 creating ECS instances within a deployment set, instances are launched in the specified region based on the pre-configured deployment strategy. Important After you select a deployment set, the maximum number of nodes in the node pool is limited. By default, a deployment set supports up to 20 × number of zones (the number of zones is determined by the vSwitches). Choose carefully and ensure sufficient quota in the deployment set to avoid node scale-out failures. |
ds-bp1d19mmbsv3jf6xxxxx |
| rds_instances |
array |
No |
The list of RDS instances. |
|
|
string |
No |
The RDS instance ID. |
rds-**** |
|
| private_pool_options |
object |
No |
The private node pool configuration. |
|
| id |
string |
No |
Private pool ID. When |
eap-bp67acfmxazb4**** |
| match_criteria |
string |
No |
Private pool type. Private pool capacity option for instance startup. After an Elasticity Assurance or Capacity Reservation takes effect, private pool capacity is generated for instance startup. 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 |
[This field is 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 strategy 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 |
Resource pool policy used when creating instances. Resource pools include private pools generated after Elasticity Assurance or Capacity Reservation takes effect, and public pools, for instance startup selection. 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 capacity is insufficient, open-type private pools are automatically matched. If no eligible private pool is available, public pools 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, instance creation fails. None: do not use resource pool policy. Default value: None. |
PrivatePoolFirst |
| private_pool_ids |
array |
No |
List of private pool IDs, i.e., Elasticity Assurance IDs or Capacity Reservation IDs. Only Target mode private pool IDs can be passed. Valid values of N: 1 to 20. |
|
|
string |
No |
Private pool ID, i.e., the Elasticity Assurance ID or Capacity Reservation ID. Only Target mode private pool IDs can be passed. |
eap-bp67acfmxazb4**** |
|
| system_disk_snapshot_policy_id |
string |
No |
The system cloud disk snapshot policy. |
sp-0jl6xnmme8v7o935**** |
| disk_init |
array |
No |
The block device initialization configuration. |
|
|
DiskInit |
No |
The DiskInit configuration. |
||
| 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. Adds labels to Kubernetes cluster nodes. |
|
| tag |
No |
The label configuration. |
||
| taints |
array |
No |
The taint configuration. |
|
| taint |
No |
The taint configuration set. |
||
| 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 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 |
The instance user data. After the node joins the cluster, the specified instance user data script runs. 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 CloudMonitor on ECS nodes. After installation, you can view monitoring information for 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, without prefix or suffix. The 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 instance pre-custom data. Before the node joins the cluster, the specified pre-custom data script runs. 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 |
[This field is deprecated] The edge node pool configuration. |
|
| cen_id |
string |
No |
[This field is deprecated] The Cloud Enterprise Network (CEN) instance ID bound to the enhanced edge node pool. |
null |
| ccn_id |
string |
No |
[This field is deprecated] The Cloud Connect Network (CCN) instance ID bound to the enhanced edge node pool. |
null |
| ccn_region_id |
string |
No |
[This field is deprecated] The region of the Cloud Connect Network instance bound to the enhanced edge node pool. |
null |
| bandwidth |
integer |
No |
[This field is deprecated] The network bandwidth of the enhanced edge node pool. Unit: Mbps. |
null |
| improved_period |
string |
No |
[This field is deprecated] The purchase duration of the enhanced edge node pool. Unit: months. |
null |
count
deprecated
|
integer |
No |
[This field is deprecated] Use desired_size instead. The number of nodes in the node pool. |
null |
max_nodes
deprecated
|
integer |
No |
[This field is 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 |
||
| worker_ram_role_name |
string |
No |
||
| auto_mode |
object |
No |
The node pool intelligent managed configuration. |
|
| 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 node component name. |
kubelet |
| version |
string |
No |
The node component version. |
1.33.3-aliyun.1 |
| config |
object |
No |
The node component configuration. |
|
| custom_config |
object |
No |
Node component custom configuration. |
{"cpuManagerPolicy":"static"} |
|
any |
No |
Node component custom configuration string. |
cpuManagerPolicy |
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.