CreateClusterNodePool
A node pool is a group of nodes that share the same properties. Node pools allow you to manage nodes in a unified way, such as upgrading nodes or using auto scaling. You can also use automated O&M features to fix OS CVE vulnerabilities, recover failed nodes, and upgrade kubelet and containerd versions. This helps reduce O&M costs. Call the CreateClusterNodePool operation 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. |
|
| nodepool_info |
object |
No |
The node pool configurations. |
|
| name |
string |
Yes |
The name of the node pool. |
nodepool-test |
| type |
string |
No |
The type of the node pool. Valid values:
Valid values:
|
ess |
| resource_group_id |
string |
No |
The ID of the resource group. The instances created in the node pool belong to this resource group. A resource can belong to only one resource group. You can use resource groups to group resources based on your business needs, such as by project, application, or organization. |
rg-acfmyvw3wjmb**** |
| auto_scaling |
object |
No |
The auto scaling configurations. |
|
| enable |
boolean |
No |
Specifies whether to enable auto scaling for the node pool. Valid values:
If you set this parameter to false, other parameters in Default value: |
false |
| type |
string |
No |
The type of instances that are created by auto scaling. This parameter takes effect only if
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 instances that can be created in the node pool. This does not include existing instances. This parameter takes effect only if The value must be in the range of[min_instances, 2000]. Default value: 0. |
10 |
| min_instances |
integer |
No |
The minimum number of instances that can be created in the node pool. This does not include existing instances. This parameter takes effect only if The value must be in the range of [0, max_instances]. Default value: 0. Note
|
1 |
is_bond_eip
deprecated
|
boolean |
No |
[This parameter is deprecated] Use internet_charge_type and internet_max_bandwidth_out instead. Specifies whether to associate an EIP with the node. Valid values:
Default value: |
null |
eip_internet_charge_type
deprecated
|
string |
No |
[This parameter is 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 |
[This parameter is 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 configurations 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 enable automatic node repair. This parameter takes effect only if
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 if
Default value: |
true |
| approval_required |
boolean |
No |
Specifies whether manual approval is required for node repair. |
|
| auto_vul_fix |
boolean |
No |
Specifies whether to automatically fix CVE vulnerabilities. This parameter takes effect only if
Default value: |
true |
| auto_vul_fix_policy |
object |
No |
The policy for automatically fixing CVE vulnerabilities. |
|
| restart_node |
boolean |
No |
Specifies whether to allow node restarts. This parameter takes effect only if
Default value: |
false |
| vul_level |
string |
No |
The vulnerability levels that can be automatically fixed. Specify the levels as a comma-separated list. Example:
Default value: |
asap,nntf |
| exclude_packages |
string |
No |
The packages to exclude from vulnerability fixing. Default value: |
kernel |
| auto_upgrade |
boolean |
No |
Specifies whether to enable automatic node upgrades. This parameter takes effect only if
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 if
Default value: |
true |
| auto_upgrade_runtime |
boolean |
No |
Specifies whether to allow automatic runtime upgrades. This parameter takes effect only if
Default value: |
false |
| auto_upgrade_os |
boolean |
No |
Specifies whether to allow automatic OS upgrades. This parameter takes effect only if
Default value: |
false |
upgrade_config
deprecated
|
object |
No |
[This parameter is deprecated] Use the The auto upgrade configurations. This parameter takes effect only if |
|
auto_upgrade
deprecated
|
boolean |
No |
[This parameter is deprecated] Use the Specifies whether to enable auto upgrade. Valid values:
|
null |
| surge |
integer |
No |
The number of extra nodes. You can specify only one of surge or During an upgrade, some nodes become unavailable. You can create extra nodes to handle the cluster workload. Note
The number of extra nodes cannot exceed the current number of nodes. |
0 |
| surge_percentage |
integer |
No |
The percentage of extra nodes. You can specify only one of surge or The number of extra nodes is calculated as: Percentage of extra nodes × Number of nodes. For example, if you set the percentage to 50% and you have 6 existing nodes, three extra nodes are created. |
0 |
| max_unavailable |
integer |
No |
The maximum number of unavailable nodes. Valid values: 1 to 1000. Default value: 1. |
1 |
| auto_fault_diagnosis |
boolean |
No |
||
| scaling_group |
object |
No |
The configurations of the scaling group for the node pool. |
|
| vswitch_ids |
array |
Yes |
A list of vSwitch IDs. You can specify from one to eight vSwitch IDs. Note
For high availability, select vSwitches in different zones. |
|
|
string |
No |
The vSwitch ID. |
vsw-wz9mfnhmssud6eicu**** |
|
| instance_types |
array |
Yes |
A list of instance types for the nodes in the node pool. When the node pool is scaled, nodes are created from these instance types. You can specify from one to 10 instance types. Note
For 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 the nodes in the node pool. Valid values:
Default value: Valid values:
|
PostPaid |
| period |
integer |
No |
The subscription duration of the nodes. This parameter is required and takes effect only if
|
1 |
| period_unit |
string |
No |
The billing cycle of the nodes in the node pool. This parameter is required and takes effect only if
Default value: |
Month |
| auto_renew |
boolean |
No |
Specifies whether to enable auto-renewal for the nodes in the node pool. This parameter takes effect only if
Default value: |
true |
| auto_renew_period |
integer |
No |
The auto-renewal period. Valid values:
Default value: 1. |
1 |
| spot_strategy |
string |
No |
The bidding strategy for the spot instances. Valid values:
For more information, see Spot instances. |
NoSpot |
| spot_price_limit |
array<object> |
No |
The price limit for a spot instance. |
|
|
object |
No |
The price range settings for a spot instance. You can set a different price range for each instance type. |
||
| instance_type |
string |
No |
The instance type of the spot instance. |
ecs.c6.large |
| price_limit |
string |
No |
The maximum price that you are willing to pay for a single instance. |
0.39 |
| image_type |
string |
No |
The OS image type. Valid values:
|
AliyunLinux3 |
| image_id |
string |
No |
The ID of the custom image. By default, the system uses the system image. |
aliyun_2_1903_x64_20G_alibase_20200529.vhd |
| system_disk_category |
string |
No |
The type of the system disk of the node. Valid values:
Default value: |
cloud_efficiency |
| system_disk_categories |
array |
No |
An array of system disk categories, ordered by priority. If a disk category is unavailable, the system attempts to create a system disk using the next category in the list. |
|
|
string |
No |
The category of the system disk. Valid values:
|
cloud_essd |
|
| system_disk_size |
integer |
No |
The size of the system disk for the node, in GiB. Value range: 20 to 2048. |
120 |
| system_disk_performance_level |
string |
No |
The performance level of the node's system disk. This parameter is valid only for Enhanced SSDs (ESSDs). The performance level of an ESSD depends on its size. For more information, see ESSDs.
|
PL1 |
| system_disk_encrypted |
boolean |
No |
Specifies whether to encrypt the system disk. Valid values:
|
false |
| system_disk_kms_key_id |
string |
No |
The ID of the KMS key that is used to encrypt the system disk. |
0e478b7a-4262-4802-b8cb-00d3fb40**** |
| system_disk_encrypt_algorithm |
string |
No |
The encryption algorithm for the system disk. Valid value: aes-256. |
aes-256 |
| system_disk_bursting_enabled |
boolean |
No |
Specifies whether to enable the performance burst feature for the system disk. Valid values:
This parameter is valid only when |
true |
| system_disk_provisioned_iops |
integer |
No |
The provisioned read/write IOPS for the system disk. Valid values: 0 to min{50,000, 1000 × Capacity - Baseline IOPS}. Baseline IOPS = min{1,800 + 50 × Capacity, 50,000}. This parameter can be set only when |
1000 |
| data_disks |
array |
No |
The data disk settings for the nodes in the node pool. |
|
| data_disk |
No |
The data disk configurations. |
||
| disk_init |
array |
No |
The block device initialization configurations. |
|
|
DiskInit |
No |
The DiskInit configurations. |
||
| security_group_ids |
array |
No |
A list of security group IDs. You must specify either |
|
|
string |
No |
A list of security group IDs. You must specify either security_group_ids or |
sg-wz9a8g2mt6x5ll****** |
|
| key_pair |
string |
No |
The name of the key pair for passwordless logon. You must specify either key_pair or Note
If you select ContainerOS for the node pool, you can specify only |
np-key-name |
| login_password |
string |
No |
The Secure Shell (SSH) logon password. You must specify either key_pair or |
**** |
| login_as_non_root |
boolean |
No |
Specifies whether to log on to the created 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. You can enable this feature only when you select Alibaba Cloud Linux 2 or Alibaba Cloud Linux 3 for the OS image. Alibaba Cloud provides baseline checks and scanning programs for Alibaba Cloud Linux 2 and Alibaba Cloud Linux 3 MLPS 2.0 Level 3 images to help you meet classified protection requirements. |
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 the public IP address. Valid values:
|
PayByTraffic |
| internet_max_bandwidth_out |
integer |
No |
The maximum outbound bandwidth for the public IP address of a node. Unit: Mbit/s. Valid values: 1 to 100. |
5 |
| tags |
array<object> |
No |
Adds tags only to ECS instances. Tag keys must be unique. A tag key can be up to 128 characters long. Tag keys and values cannot start with "aliyun" or "acs:", and cannot contain "http://" or "https://". |
|
|
object |
No |
The node tag. |
||
| key |
string |
No |
The name of the tag. |
node-k-1 |
| value |
string |
No |
The value of the tag. |
node-v-1 |
| desired_size |
integer |
No |
The expected number of nodes to create and maintain in the node pool. Adjust this value to scale the node pool out or in. To ensure that cluster components run as expected, set this value to at least 2. If you do not want to create any nodes, set this parameter to 0. You can manually adjust the number of nodes later. |
0 |
| multi_az_policy |
string |
No |
The scaling policy for ECS instances in the multi-zone scaling group. Valid values:
Default value: |
COST_OPTIMIZED |
| scaling_policy |
string |
No |
The scaling mode of the scaling group. Valid values:
Default value: |
release |
| on_demand_base_capacity |
integer |
No |
The minimum number of pay-as-you-go instances to maintain in the scaling group. Valid values: [0,1000]. If the number of pay-as-you-go instances falls below this value, the system creates pay-as-you-go instances first. |
0 |
| on_demand_percentage_above_base_capacity |
integer |
No |
The percentage of pay-as-you-go instances for additional capacity above |
20 |
| spot_instance_pools |
integer |
No |
The number of instance types to use for spot instances. The scaling group creates spot instances from a pool of the lowest-priced instance types. This parameter sets the size of this pool. Valid values: 1 to 10. |
5 |
| spot_instance_remedy |
boolean |
No |
Specifies whether to enable the instance replacement feature. If enabled, the scaling group attempts to replace a spot instance that is about to be reclaimed by creating a new one. Valid values:
|
false |
| compensate_with_on_demand |
boolean |
No |
If
|
true |
| deploymentset_id |
string |
No |
The ID of the deployment set. A deployment set deploys the ECS instances in a node pool to different physical servers. This ensures high availability and disaster recovery. When you create an ECS instance in a deployment set, the system starts the ECS instance in the specified region based on the specified deployment policy. Important If you specify a deployment set, the maximum number of nodes in the node pool is limited. By default, the maximum number of nodes that a deployment set supports is 20 × the number of zones. The number of zones is determined by the specified vSwitches. Select a deployment set with caution to ensure that its quota is sufficient to prevent node creation failures. |
ds-bp1d19mmbsv3jf6xxxxx |
| rds_instances |
array |
No |
A list of RDS instances. |
|
|
string |
No |
The ID of the RDS instance. |
rds-**** |
|
| private_pool_options |
object |
No |
Configurations for the private node pool. |
|
| id |
string |
No |
The ID of the private node pool. This parameter is required if |
eap-bp67acfmxazb4**** |
| match_criteria |
string |
No |
The matching criteria for the private pool. A private pool provides reserved capacity from an elasticity assurance or a capacity reservation. This parameter determines how the system uses this reserved capacity to launch instances. Valid values:
|
Target |
security_group_id
deprecated
|
string |
No |
The ID of the security group for the node pool. You must specify either this parameter or |
sg-wz9a8g2mt6x5llu0**** |
platform
deprecated
|
string |
No |
[Deprecated] Use the The OS distribution. Valid values:
Default value: |
null |
| instance_patterns |
array |
No |
The instance property configurations. |
|
| instance_patterns |
No |
The instance properties. |
||
| ram_role_name |
string |
No |
The name of the worker RAM role.
Important This parameter is available only for ACK managed clusters that run Kubernetes 1.22 or later. |
example-role |
| instance_metadata_options | InstanceMetadataOptions |
No |
The ECS instance metadata access configurations. |
|
| resource_pool_options |
object |
No |
The resource pool and policy used to create instances. This parameter takes effect only when you create pay-as-you-go instances. This parameter cannot be set at the same time as private_pool_options.match_criteria and private_pool_options.id. |
|
| strategy |
string |
No |
The policy for the resource pool used to create instances. A resource pool consists of a private pool and a public pool. A private pool is created when an elasticity assurance or a capacity reservation service takes effect. Valid values:PrivatePoolFirst: The system prioritizes using a private pool. If you specify resource_pool_options.private_pool_ids, the system attempts to use that pool first. If that pool has insufficient capacity, or if you do not specify a pool, the system searches for other available private pools. If no suitable private pool is found, the system uses the public pool.PrivatePoolOnly: The system uses only the private pool specified in resource_pool_options.private_pool_ids. This parameter is required. If the specified pool has insufficient capacity, instances are not created.None: No resource pool policy is used.Default value: None. |
PrivatePoolFirst |
| private_pool_ids |
array |
No |
A list of private pool IDs. The IDs are for elasticity assurance services or capacity reservation services. You can specify only the IDs of private pools in Target mode. The list can contain 1 to 20 IDs. |
|
|
string |
No |
The ID of the private pool. This is the ID of an elasticity assurance service or a capacity reservation service. You can specify IDs only for private pools that are in Target mode. |
eap-bp67acfmxazb4**** |
|
| system_disk_snapshot_policy_id |
string |
No |
The ID of the snapshot policy for the system disk. |
sp-0jl6xnmme8v7o935**** |
| node_config |
object |
No |
The node configurations. |
|
| kubelet_configuration | kubelet_config |
No |
The kubelet parameter settings. |
|
| kubernetes_config |
object |
No |
The configurations of the cluster. |
|
| labels |
array |
No |
The labels to add to the nodes in the node pool. |
|
| tag |
No |
The tag configuration. |
||
| taints |
array |
No |
The taints to apply to the nodes. |
|
| taint |
No |
A collection of taint configurations. |
||
| runtime |
string |
No |
The name of the container runtime. ACK supports the following container runtimes.
Default value: containerd. |
containerd |
| runtime_version |
string |
No |
The version of the container runtime. |
1.6.38 |
| cpu_policy |
string |
No |
The CPU management policy for the node. If your cluster runs Kubernetes 1.12.6 or later, the following policies are supported:
Default value: |
none |
| user_data |
string |
No |
The user data for the instance. The script is run after the node joins the cluster. 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 Cloud Monitor on the ECS nodes. After Cloud Monitor is installed, you can view monitoring information for the created ECS instances in the Cloud Monitor console. We recommend that you enable this feature. Valid values:
Default value: |
false |
| node_name_mode |
string |
No |
The custom node name. After you specify a custom node name, the node name, ECS instance name, and ECS instance hostname are changed at the same time. Note
For a Windows instance for which a custom node name is enabled, the hostname is fixed to the IP address. The system replaces periods (.) in the IP address with hyphens (-). The hostname does not contain a prefix or suffix. A node name consists of a prefix, the node IP address, and a suffix.
For example, the IP address of a node 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 user data to run on a node before it is added to the cluster. For more information, see User-Data script. |
dGhpcyBpcyBhIGV4YW1wbGU |
| tee_config |
object |
No |
The configurations of the Kubernetes cluster for confidential computing. |
|
| tee_enable |
boolean |
No |
Specifies whether to enable confidential computing on the nodes in the node pool.
|
true |
interconnect_config
deprecated
|
object |
No |
[This parameter is deprecated] The configurations of the edge node pool. |
|
| cen_id |
string |
No |
[This parameter is deprecated] The ID of the CEN instance that is associated with the enhanced edge node pool. |
null |
| ccn_id |
string |
No |
[This parameter is deprecated] The ID of the CCN instance that is associated with the enhanced edge node pool. |
null |
| ccn_region_id |
string |
No |
[This parameter is deprecated] The region of the CCN instance for the enhanced edge node pool. |
null |
| bandwidth |
integer |
No |
[This parameter is deprecated] The network bandwidth of the enhanced edge node pool. Unit: Mbit/s. |
null |
| improved_period |
string |
No |
[This parameter is deprecated] The subscription duration of the enhanced edge node pool. Unit: month. |
null |
count
deprecated
|
integer |
No |
[This parameter is deprecated] Use desired_size instead. The number of nodes in the node pool. |
null |
max_nodes
deprecated
|
integer |
No |
[This parameter is deprecated] The maximum number of nodes in the edge node pool. |
null |
| interconnect_mode |
string |
No |
The network type of the edge node pool. This parameter applies only to node pools of the
|
basic |
| host_network |
boolean |
No |
Specifies whether to use the host network for the pod network.
|
true |
| intranet |
boolean |
No |
Specifies whether nodes in the edge node pool can communicate with each other at Layer 3.
|
true |
| eflo_node_group |
object |
No |
The configurations of the Lingjun node pool. |
|
| cluster_id |
string |
No |
The ID of the Lingjun cluster that you want to associate with the Lingjun node pool. |
i1169130516633730**** |
| group_id |
string |
No |
The ID of the Lingjun group in the Lingjun cluster to associate with the Lingjun node pool. |
ng-ec3c96ff0aa**** |
| auto_mode |
object |
No |
The intelligent hosting settings for the node pool. |
|
| enable |
boolean |
No |
Specifies whether to enable the intelligent hosting mode. Valid values:
|
true |
| node_components |
array<object> |
No |
A list of node components. |
|
|
array<object> |
No |
The node components. |
||
| 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 configurations of the node component. |
|
| custom_config |
object |
No |
The custom configurations of the node component. |
|
|
string |
No |
The custom configuration string of the node component. |
cpuManagerPolicy |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The node pool configurations. |
||
| nodepool_id |
string |
The ID of the node pool. |
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.