Creates a node pool for a Container Service for Kubernetes (ACK) cluster. You can use node pools to facilitate node management. For example, you can schedule, configure, or maintain nodes by node pool, and enable auto scaling for a node pool. We recommend that you use a managed node pool, which can help automate specific O\\\\\\&M tasks for nodes, such as Common Vulnerabilities and Exposures (CVE) patching and node repair. This reduces your O\\\\\\&M workload.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
cs:CreateClusterNodePool | create | *Cluster acs:cs:{#regionId}:{#accountId}:cluster/{#ClusterId} |
| none |
Request syntax
POST /clusters/{ClusterId}/nodepools HTTP/1.1
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ClusterId | string | Yes | The ID of the cluster. | c61da77e8bfbc4c4c999af2b51b65**** |
body | object | No | The request body parameters. | |
nodepool_info | object | No | The configurations of the node pool. | |
name | string | Yes | The name of the node pool. | cluster-demo |
type | string | No | The type of node pool. Valid values:
| ess |
resource_group_id | string | No | The ID of the resource group to which the node pool belongs. Instances that are added to the node pool belong to this resource group. | rg-acfmyvw3wjmb**** |
auto_scaling | object | No | The configurations of auto scaling. | |
enable | boolean | No | Specifies whether to enable auto scaling for the node pool. Valid values:
Default value: | true |
type | string | No | The instance type that is used for auto scaling. This parameter takes effect only if
Default value: Note
You cannot modify this parameter after the node pool is created.
| cpu |
max_instances | long | No | The maximum number to which the Elastic Compute Service (ECS) instances in the node pool can be scaled. The number of nodes in the node pool cannot be greater than this value. This parameter takes effect only if | 10 |
min_instances | long | No | The minimum number to which the ECS instances in the node pool can be scaled. The number of nodes in the node pool cannot be smaller than this value. This parameter takes effect only if | 1 |
is_bond_eipdeprecated | boolean | No | This parameter is deprecated. Specifies whether to associate an elastic IP address (EIP) with the node pool. Valid values:
Default value: ** Important This parameter is deprecated. Use the internet_charge_type and internet_max_bandwidth_out parameters instead. | true |
eip_internet_charge_typedeprecated | string | No | This parameter is deprecated. The metering method of the EIP. Valid values:
Default value: ** Important This parameter is deprecated. Use the internet_charge_type and internet_max_bandwidth_out parameters instead. | PayByBandwidth |
eip_bandwidthdeprecated | long | No | This parameter is deprecated. The maximum bandwidth of the EIP. Unit: Mbit/s. ** Important This parameter is deprecated. Use the internet_charge_type and internet_max_bandwidth_out parameters instead. | 5 |
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 auto node repair. This parameter takes effect only if
If | false |
auto_repair_policy | object | No | The auto node repair policy. | |
restart_node | boolean | No | Specifies whether to allow node restart. This parameter takes effect only if
If | true |
auto_vul_fix | boolean | No | Specifies whether to enable auto Common Vulnerabilities and Exposures (CVE) patching. This parameter takes effect only if
If | true |
auto_vul_fix_policy | object | No | The auto CVE patching policy. | |
restart_node | boolean | No | Specifies whether to allow node restart. This parameter takes effect only if
| true |
vul_level | string | No | The severity levels of CVEs that can be automatically patched. Separate multiple levels with commas (,). Example:
If | asap,nntf |
auto_upgrade | boolean | No | Specifies whether to enable auto node update. This parameter takes effect only if
If | true |
auto_upgrade_policy | object | No | The auto node update policy. | |
auto_upgrade_kubelet | boolean | No | Specifies whether to allow auto update of the kubelet. This parameter takes effect only if
If | true |
auto_upgrade_runtime | boolean | No | Specifies whether to allow auto update of the runtime. This parameter takes effect only if
Default value: | |
auto_upgrade_os | boolean | No | Specifies whether to allow auto update of the OS. This parameter takes effect only if
Default value: | |
upgrade_configdeprecated | object | No | The configurations of auto update. The configurations take effects only if | |
auto_upgradedeprecated | boolean | No | Specifies whether to enable auto update. Valid values:
** Caution This parameter is deprecated. Use the preceding auto_upgrade parameter instead. | false |
surge | long | No | The number of additional nodes. | 0 |
surge_percentage | long | No | The percentage of additional nodes that are temporarily added to the node pool during an auto update. You must set this parameter or | 0 |
max_unavailable | long | No | The maximum number of nodes that can be in the Unavailable state. Valid values: 1 to 1000. Default value: 1 | |
scaling_group | object | No | The configurations of the scaling group that is used by the node pool. | |
vswitch_ids | array | Yes | The vSwitch IDs. You can specify one to eight vSwitch IDs. Note
To ensure high availability, we recommend that you select vSwitches that reside in different zones.
| |
string | No | The vSwitch IDs. | vsw-wz9mfnhmssud6eicu**** | |
instance_types | array | Yes | The instance types of nodes in the node pool. When the system adds a node to the node pool, the system selects the most appropriate one from the specified instance types for the node. You can specify 1 to 10 instance types. Note
To ensure high availability, we recommend that you specify multiple instance types.
| |
string | No | The instance types of nodes in the node pool. | ecs.d1ne.2xlarge | |
instance_charge_type | string | Yes | The billing method of nodes in the node pool. Valid values:
Default value: | PrePaid |
period | long | No | The subscription duration of nodes in the node pool. This parameter takes effect and is required if you set
| 1 |
period_unit | string | No | The billing cycle of nodes in the node pool. This parameter takes effect and is required if you set
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 you set
Default value: | true |
auto_renew_period | long | No | The auto-renewal period. Valid values:
Default value: 1 | 1 |
spot_strategy | string | No | The bidding policy of preemptible instances. Valid values:
For more information, see Use preemptible instances. | NoSpot |
spot_price_limit | array<object> | No | The instance type of preemptible instances and the price cap for the instance type. | |
object | No | The price cap of a preemptible instance. You can specify different price caps for different instance types. | ||
instance_type | string | No | The instance type of preemptible instances. | ecs.c6.large |
price_limit | string | No | The price cap of a preemptible instance of the type. | 0.39 |
image_type | string | No | The type of the OS image. You must specify this parameter or
| AliyunLinux |
image_id | string | No | The custom image ID. By default, the image provided by Container Service for Kubernetes (ACK) is used. | aliyun_2_1903_x64_20G_alibase_20200529.vhd |
system_disk_category | string | No | The category of the system disk for nodes. Valid values:
Default value: | cloud_efficiency |
system_disk_categories | array | No | The categories of the system disk for nodes. The system attempts to create system disks of a disk category with a lower priority if the disk category with a higher priority is unavailable. Valid values: Valid values:
| |
string | No | The category of the system disk for nodes. | cloud_essd | |
system_disk_size | long | No | The size of the system disk. Unit: GiB. Valid values: 20 to 20248. | 120 |
system_disk_performance_level | string | No | The performance level (PL) of the system disk. This parameter takes effect only for an ESSD.
Note
Disks support all of the preceding PLs. However, when you create a disk, the available PLs vary based on the ECS instance type that you selected. For more information, see Overview of ECS instance families.
| PL1 |
system_disk_encrypted | boolean | No | Specifies whether to encrypt the system disk. Valid values: true: encrypts the system disk. false: does not encrypt the system disk. | false |
system_disk_kms_key_id | string | No | The ID of the Key Management Service (KMS) key that is used to encrypt the system disk. | 0e478b7a-4262-4802-b8cb-00d3fb40**** |
system_disk_encrypt_algorithm | string | No | The encryption algorithm that is used to encrypt the system disk. Set the value to aes-256. | aes-256 |
system_disk_bursting_enabled | boolean | No | Specifies whether to enable the burst feature for the system disk. Valid values:
This parameter is available only when | true |
system_disk_provisioned_iops | long | No | The preset read/write IOPS of the system disk. Valid values: 0 to min{50,000, 1,000 × Capacity - Baseline IOPS} Baseline IOPS = min{1,800 + 50 × Capacity, 50,000}. This parameter is supported only when | 1000 |
data_disks | array | No | The configurations of the data disks that are attached to nodes in the node pool. | |
data_disk | No | The configurations of the data disk. | ||
security_group_ids | array | No | The IDs of security groups. You must specify this parameter or | |
string | No | The security group ID. You must specify this parameter or | sg-wz9a8g2mt6x5llu0**** | |
key_pair | string | No | The name of the key pair used to log on to nodes in the node pool. You must set this parameter or Note
If you select ContainerOS as the OS of nodes in the node pool, you must specify key_pair .
| np-key-name |
login_password | string | No | The password for SSH logon. You must specify this parameter or the | Hello1234 |
login_as_non_root | boolean | No | Specifies whether to allow a non-root user to log on to an ECS instance that is added to the node pool. | true |
cis_enableddeprecated | boolean | No | This parameter is deprecated. Use the security_hardening_os parameter instead. | false |
soc_enabled | boolean | No | Specifies whether to enable MLPS Security Hardening. You can enable security hardening based on Multi-Level Protection Scheme (MLPS) only when Alibaba Cloud Linux 2 or Alibaba Cloud Linux 3 is installed on nodes. Alibaba Cloud provides standards for baseline checks and a scanner to ensure the compliance of Alibaba Cloud Linux 2 and Alibaba Cloud Linux 3 images with the level 3 standards of MLPS 2.0. | false |
security_hardening_os | boolean | No | Specifies whether to enable Alibaba Cloud Linux Security Hardening. Valid values:
Default value: | |
internet_charge_type | string | No | The metering method of the public IP address. Valid values:
| PayByTraffic |
internet_max_bandwidth_out | long | No | The maximum outbound bandwidth of the public IP address. Unit: Mbit/s. Valid values: 1 to 100. | 5 |
tags | array<object> | No | The labels that you want to add only to ECS instances. The label key must be unique and cannot exceed 128 characters in length. The label key and value cannot start with aliyun or acs: or contain https:// or http://. | |
object | No | The tag. | ||
key | string | No | The tag key. | |
value | string | No | The tag value. | |
desired_size | long | No | The expected number of nodes in the node pool. | 0 |
multi_az_policy | string | No | The ECS instance scaling policy for 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 | long | No | The minimum number of pay-as-you-go instances that must be kept in the scaling group. Valid values: 0 to 1000. If the number of pay-as-you-go instances is less than the value of this parameter, the system preferably creates pay-as-you-go instances. | 0 |
on_demand_percentage_above_base_capacity | long | No | The percentage of pay-as-you-go instances among the extra instances that exceed the number specified by | 20 |
spot_instance_pools | long | No | The number of instance types that are available for creating preemptible instances. Auto Scaling creates preemptible instances of multiple instance types that are available at the lowest cost. Valid values: 1 to 10. | 5 |
spot_instance_remedy | boolean | No | Specifies whether to enable the supplementation of preemptible instances. If you set this parameter to true, when the scaling group receives a system message indicating that a preemptible instance is to be reclaimed, the scaling group attempts to create a new instance to replace this instance. Valid values:
| false |
compensate_with_on_demand | boolean | No | Specifies whether to automatically create pay-as-you-go instances to meet the required number of ECS instances if preemptible instances cannot be created due to reasons such as the price or insufficient inventory. This parameter takes effect when you set
| true |
deploymentset_id | string | No | The ID of the deployment set. | ds-bp1d19mmbsv3jf6xxxxx |
rds_instances | array | No | A list of ApsaraDB RDS instances. | |
string | No | The ID of the ApsaraDB RDS instance. | rds-**** | |
private_pool_options | object | No | The configurations of the private node pool. | |
id | string | No | The ID of the private node pool. | eap-bp67acfmxazb4**** |
match_criteria | string | No | The type of private node pool. This parameter specifies the type of private pool that you want to use to create instances. A private pool is generated when an elasticity assurance or a capacity reservation takes effect. The system selects a private pool to start instances. Valid values:
| Open |
security_group_iddeprecated | string | No | The ID of the security group to which you want to add the node pool. You must specify this parameter or the | sg-wz9a8g2mt6x5llu0**** |
platformdeprecated | string | No | The operating system distribution. Valid values:
Default value: | AliyunLinux |
instance_patterns | array | No | The instance properties. | |
instance_patterns | No | The instance properties. | ||
ram_role_name | string | No | The name of the worker RAM role.
This parameter is available only to users in the whitelist. To use this parameter, submit a ticket. Note
This parameter is available only for ACK managed clusters that run Kubernetes 1.22 or later.
| example-role |
node_config | object | No | The node configurations. | |
kubelet_configuration | kubelet_config | No | The configurations of the kubelet. | |
kubernetes_config | object | No | The configurations of the cluster. | |
labels | array | No | The labels that you want to add to the nodes in the cluster. | |
tag | No | The configuration of the tag. | ||
taints | array | No | The configuration of the taint. | |
taint | No | The collection of taint configurations. | ||
runtime | string | No | The name of the container runtime. The following types of runtime are supported by ACK:
Default value: containerd. | docker |
runtime_version | string | No | The version of the container runtime. | 19.03.5 |
cpu_policy | string | No | The CPU management policy of nodes. The following policies are supported if the Kubernetes version of the cluster is 1.12.6 or later:
Default value: | none |
user_data | string | No | The user-defined data of nodes. You can specify custom scripts that are automatically executed after the nodes are initialized. | dGhpcyBpcyBhIGV4YW1wbGU= |
unschedulable | boolean | No | Specifies whether the nodes are schedulable after a scale-out operation is performed. | true |
cms_enabled | boolean | No | Specifies whether to install the CloudMonitor agent on ECS nodes. After the CloudMonitor agent is installed on ECS nodes, you can view monitoring information about the instances in the CloudMonitor console. We recommend that you install the CloudMonitor agent. Valid values:
Default value: | true |
node_name_mode | string | No | A custom node name consists of a prefix, a node IP address, and a suffix.
Set the parameter to a value in the customized,aliyun,ip,com format. The value consists of four parts that are separated by commas (,). customized and ip are fixed content. aliyun is the prefix and com is the suffix. Example: aliyun.192.168.xxx.xxx.com. | customized,aliyun,ip,com |
pre_user_data | string | No | The user-defined data of nodes. You can specify custom scripts that are automatically executed before the nodes are initialized. | dGhpcyBpcyBhIGV4YW1wbGU |
tee_config | object | No | The configurations of confidential computing for the cluster. | |
tee_enable | boolean | No | Specifies whether to enable confidential computing for the cluster. | true |
interconnect_configdeprecated | 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 Cloud Enterprise Network (CEN) instance that is associated with the enhanced edge node pool. | cen-ey9k9nfhz0f******* |
ccn_id | string | No | This parameter is deprecated. The ID of the Cloud Connect Network (CCN) instance that is associated with the enhanced edge node pool. | ccn-qm5i0i0q9yi******* |
ccn_region_id | string | No | This parameter is deprecated. The region to which the CCN instance that is associated with the enhanced edge node pool belongs. | cn-shanghai |
bandwidth | long | No | This parameter is deprecated. The bandwidth of the enhanced edge node pool. Unit: Mbit/s. | 10 |
improved_period | string | No | This parameter is deprecated. The subscription duration of the enhanced edge node pool. The duration is measured in months. | 1 |
countdeprecated | long | No | This parameter is deprecated. Use the desired_size parameter instead. The number of nodes in the node pool. | 1 |
max_nodesdeprecated | long | No | This parameter is deprecated. The maximum number of nodes that can be contained in the edge node pool. | 10 |
interconnect_mode | string | No | The network type of the edge node pool. This parameter takes effect only when the
| basic |
host_network | boolean | No | Specifies whether set the network type of the pod to host network.
| true |
intranet | boolean | No | Specifies whether all nodes in the edge node pool can communicate with each other at Layer 3.
| true |
Response parameters
Examples
Sample success responses
JSON
format
{
"nodepool_id": "np31da1b38983f4511b490fc62108a****",
"task_id": "T-613b19bbd160ad492800****",
"request_id": "0527ac9a-c899-4341-a21a-****"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-11-05 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2024-09-27 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2024-07-09 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2024-06-13 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2024-06-13 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2024-04-22 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2024-04-19 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2024-01-19 | The response structure of the API has changed | View Change Details |
2023-12-13 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2023-10-17 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2023-09-01 | The response structure of the API has changed | View Change Details |
2023-08-08 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2020-09-24 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2020-09-24 | The internal configuration of the API is changed, but the call is not affected | View Change Details |