Creates a node pool for a cluster. 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.
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 created 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 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 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 node pool configuration. |
|
| 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 automatic node repair policy. |
|
| restart_node |
boolean |
No |
Specifies whether to allow node restart. This parameter takes effect only when
Default value: |
true |
| approval_required |
boolean |
No |
Specifies 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 automatic CVE fix policy. |
|
| restart_node |
boolean |
No |
Specifies whether to allow node restart. This parameter takes effect only when
Default value: |
false |
| vul_level |
string |
No |
The vulnerability levels 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 |
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 upgrade. This parameter takes effect only when
Default value: |
true |
| auto_upgrade_runtime |
boolean |
No |
Specifies whether to allow automatic runtime upgrade. This parameter takes effect only when
Default value: |
false |
| auto_upgrade_os |
boolean |
No |
Specifies whether to allow automatic operating system upgrade. 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 upgrade. Valid values:
|
null |
| surge |
integer |
No |
The number of extra nodes. Specify either this parameter or Nodes become unavailable during an upgrade. 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. 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 values: [1,1000]. Default value: 1. |
1 |
| auto_fault_diagnosis |
boolean |
No |
||
| drift_enabled |
boolean |
No |
||
| 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 nodes in the node pool. When the node pool scales out, 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 cycle 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 duration of each auto-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 price limit configuration for the current spot instance type. |
|
|
object |
No |
The price limit configuration for spot instances. You can set different price limits 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 |
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 system cloud disk for nodes. 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 attempts 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 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 is related to 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 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 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 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. Mutually exclusive with |
|
|
string |
No |
The list of security group IDs. Mutually exclusive with |
sg-wz9a8g2mt6x5ll****** |
|
| key_pair |
string |
No |
The name of the key pair for password-free logon. 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. Mutually exclusive with |
**** |
| login_as_non_root |
boolean |
No |
Specifies whether to log on to the 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 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 have a maximum length of 128 characters. Tag keys and 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 node count. If you do not need to create nodes, set this value to 0 and manually adjust it later to add nodes. |
0 |
| multi_az_policy |
string |
No |
The multi-zone scaling policy |
COST_OPTIMIZED |
| scaling_policy |
string |
No |
The scaling group pattern. 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 with priority 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 multiple instance types with the lowest cost. Valid values: [1,10]. |
5 |
| spot_instance_remedy |
boolean |
No |
Specifies whether to enable supplementation of spot instances. If 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 |
Specifies whether to allow automatic creation of pay-as-you-go instances to meet ECS instance quantity requirements 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 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 × number of zones (the number of zones is determined by the vSwitches). Select 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 RDS instances. |
|
|
string |
No |
The 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 private pool capacity option for instance startup. After an elasticity assurance or capacity reservation takes effect, a private pool 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 |
The resource pool strategy 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 strategy 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 private pools are automatically matched. If no matching private pool is available, public pool resources are used. PrivatePoolOnly: Private pool only. When this strategy is selected, resouce_pool_options.private_pool_ids must be specified. If the specified private pool capacity is insufficient, instance startup fails. None: No resource pool strategy 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 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 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 is executed. 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 of 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 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 is executed. 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 subscription 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 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 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 |
The node component custom configuration. |
{"cpuManagerPolicy":"static"} |
|
any |
No |
The 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.