You can call the CreateClusterNodePool operation to create a node pool for a Container Service for Kubernetes (ACK) cluster.
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 | Write |
|
| none |
Request syntax
POST /clusters/{ClusterId}/nodepools
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ClusterId | string | Yes | The ID of the cluster. | c61da77e8bfbc4c4c999af2b51b65**** |
body | object | No | The request body. | |
auto_scaling | object | No | The configuration of auto scaling. | |
enable | boolean | No | Specifies whether to enable auto scaling. Valid values:
Default value: | true |
max_instances | long | No | The maximum number of Elastic Compute Service (ECS) instances that can be created in a node pool. | 10 |
min_instances | long | No | The minimum number of ECS instances that must be kept in a node pool. | 1 |
type | string | No | The instance types that can be used for the auto scaling of the node pool. Valid values:
Default value: | cpu |
is_bond_eip | boolean | No | This parameter is deprecated. Specifies whether to associate an elastic IP address (EIP) with the node pool. Valid values:
Default value: | true |
eip_internet_charge_type | string | No | This parameter is deprecated. The metering method of the EIP. Valid values:
Default value: | PayByBandwidth |
eip_bandwidth | long | No | This parameter is deprecated. The maximum bandwidth of the EIP. Unit: Mbit/s. | 5 |
kubernetes_config | object | No | The configuration of the cluster. | |
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 |
cpu_policy | string | No | The CPU management policy of the nodes in a node pool. The following policies are supported if the Kubernetes version of the cluster is 1.12.6 or later.
Default value: | none |
labels | array | No | The labels that you want to add to the nodes in the cluster. | |
tag | No | The configuraiton of labels. | ||
runtime | string | No | The container runtime. | docker |
runtime_version | string | No | The version of the container runtime. | 19.03.5 |
taints | array | No | The configuration of taints. | |
taint | No | The list of taints. | ||
user_data | string | No | The user-defined data on nodes. | dGhpcyBpcyBhIGV4YW1wbGU= |
node_name_mode | string | No | A custom node name consists of a prefix, a node IP address, and a suffix.
Set the 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 |
nodepool_info | object | No | The configuration of the node pool. | |
name | string | Yes | The name of the node pool. | cluster-demo |
resource_group_id | string | No | The ID of the resource group to which the node pool belongs. | rg-acfmyvw3wjmb**** |
type | string | No | The type of node pool. Valid values:
| ess |
scaling_group | object | No | The configuration of the scaling group that is used by the node pool. | |
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 duration of the auto-renewal. This parameter takes effect and is required only when you set instance_charge_type to PrePaid and auto_renew to true. If Default value: 1. | 1 |
data_disks | array | No | The configuration of the data disks that are mounted to the nodes in the node pool. | |
data_disk | No | The configuration of data disks. | ||
image_id | string | No | The ID of a custom image. By default, the image provided by ACK is used. | aliyun_2_1903_x64_20G_alibase_20200529.vhd |
instance_charge_type | string | Yes | The billing method of the nodes in the node pool. Valid values:
Default value: | PrePaid |
instance_types | array | Yes | The instance type of the nodes in the node pool. | |
string | No | The type of instance. | ecs.d1ne.2xlarge | |
key_pair | string | No | The name of the key pair. You must set this parameter or the Note
If you want to create a managed node pool, you must set key_pair .
| np-key-name |
login_password | string | No | The password for SSH logon. You must set this parameter or the | Hello1234 |
period | long | No | The subscription duration of the nodes in the node pool. This parameter takes effect and is required only when you set Default value: 1. | 1 |
period_unit | string | No | The billing cycle of the nodes in the node pool. This parameter is required if you set instance_charge_type to | Month |
platform | string | No | The release version of the operating system. Valid values:
Default value: | AliyunLinux |
rds_instances | array | No | A list of ApsaraDB RDS instances. | |
string | No | The IDs of ApsaraDB RDS instances. | rds-**** | |
spot_strategy | string | No | The bidding policy of preemptible instances. Valid values:
For more information, see Preemptible instances. | NoSpot |
spot_price_limit | object [] | No | The instance type of preemptible instance and the maximum bid price. | |
instance_type | string | No | The instance type of preemptible instance. | ecs.c6.large |
price_limit | string | No | The maximum bid price of a preemptible instance. | 0.39 |
scaling_policy | string | No | The scaling mode of the scaling group. Valid values:
Default value: | release |
security_group_id | string | No | Specifies the ID of the security group to which you want to add the node pool. You must set this parameter or | sg-wz9a8g2mt6x5llu0**** |
security_group_ids | array | No | The IDs of security groups to which you want to add the node pool. You must set this parameter or | |
string | No | The IDs of security groups to which you want to add the node pool. You must set this parameter or | sg-wz9a8g2mt6x5llu0**** | |
system_disk_category | string | No | The type of system disk. Valid values:
Default value: | cloud_efficiency |
system_disk_size | long | No | The system disk size of a node. Unit: GiB. Valid values: 40 to 500. | 120 |
system_disk_performance_level | string | No | The performance level (PL) of the system disk that you want to use for the node. This parameter takes effect only for ESSDs.
| PL1 |
system_disk_provisioned_iops | long | No | The predefined IOPS of a 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 |
system_disk_bursting_enabled | boolean | No | Specifies whether to enable the burst feature for system disks. Valid values:
This parameter is supported only when | true |
tags | object [] | No | The labels that you want to add to the ECS instances. Each key must be unique and cannot exceed 128 characters in length. Neither keys nor values can start with aliyun or acs:. Neither keys nor values can contain https:// or http://. | |
key | string | No | The key of a label. | |
value | string | No | The value of a label. | |
vswitch_ids | array | Yes | The vSwitch IDs. Valid values: 1 to 8. Note
To ensure high availability, we recommend that you select vSwitches that reside in different zones.
| |
string | No | The vSwitch ID. | vsw-wz9mfnhmssud6eicu**** | |
multi_az_policy | string | No | The ECS instance scaling policy for a multi-zone scaling group. Valid values:
Default value: | COST_OPTIMIZED |
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, Auto Scaling 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. 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 supplement preemptible instances when the number of preemptible instances drops below the specified minimum number. If this parameter is set to true, when the scaling group receives a system message 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 cost or insufficient inventory. This parameter takes effect when you set
| true |
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 of the node. Unit: Mbit/s. Valid values: 1 to 100. | 5 |
image_type | string | No | The type of OS image. You must set this parameter or
| AliyunLinux |
deploymentset_id | string | No | The ID of the deployment set to which the ECS instances in the node pool belong. | ds-bp1d19mmbsv3jf6xxxxx |
desired_size | long | No | The expected number of nodes in the node pool. | 0 |
private_pool_options | object | No | The configuration 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 node pool is generated when an elasticity assurance or a capacity reservation service takes effect. The system selects a private node pool to launch instances. Valid values:
| Open |
tee_config | object | No | The configuration of confidential computing for the cluster. | |
tee_enable | boolean | No | Specifies whether to enable confidential computing for the cluster. | true |
management | object | No | The configuration of the managed node pool feature. | |
enable | boolean | No | Specifies whether to enable the managed node pool feature. Valid values:
| false |
auto_repair | boolean | No | Specifies whether to enable auto repair. This parameter takes effect only when you specify
| false |
upgrade_config | object | No | The configuration of auto update. The configuration takes effect only when you specify | |
auto_upgrade | boolean | No | Indicates whether auto update is enabled. Valid values:
| false |
surge | long | No | The number of nodes that are temporarily added to the node pool during an auto update. | 0 |
surge_percentage | long | No | The percentage of additional nodes to the nodes in the node pool. You must set this parameter or | 0 |
max_unavailable | long | No | The maximum number of nodes that can be in the Unschedulable state. Valid values: 1 to 1000. Default value: 1. | |
count | long | No | This parameter is deprecated. Use the desired_size parameter instead. The number of nodes in the node pool. | 1 |
interconnect_mode | string | No | The network type of the edge node pool. This parameter takes effect only when you set the
| basic |
interconnect_config | object | No | This parameter is deprecated. The configuration 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 |
max_nodes | long | No | The maximum number of nodes that can be created in the edge node pool. You must specify a value that is equal to or larger than 0. A value of 0 indicates that the number of nodes in the node pool is limited only by the quota of nodes in the cluster. In most cases, this parameter is set to a value larger than 0 for edge node pools. This parameter is set to 0 for node pools of the ess type or default edge node pools. | 10 |
Response parameters
Examples
Sample success responses
JSON
format
{
"nodepool_id": "np31da1b38983f4511b490fc62108a****",
"task_id": "T-613b19bbd160ad492800****"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||
---|---|---|---|---|
2024-01-19 | The response structure of the API has changed | see changesets | ||
| ||||
2023-12-13 | The internal configuration of the API is changed, but the call is not affected | see changesets | ||
| ||||
2023-10-17 | The internal configuration of the API is changed, but the call is not affected | see changesets | ||
| ||||
2023-09-01 | The response structure of the API has changed | see changesets | ||
| ||||
2023-08-08 | The internal configuration of the API is changed, but the call is not affected | see changesets | ||
| ||||
2020-09-24 | The internal configuration of the API is changed, but the call is not affected | see changesets | ||
| ||||
2020-09-24 | The internal configuration of the API is changed, but the call is not affected | see changesets | ||
|