You can call the CreateClusterNodePool operation to create a node pool for a Container Service for Kubernetes (ACK) cluster.
Debugging
Request headers
This operation does not have operation-specific request headers and uses only common request headers. For more information, see Common request parameters.
Request syntax
POST /clusters/{ClusterId}/nodepools HTTP/1.1
Request parameters
Parameter |
Type |
Position |
Required |
Example |
Description |
ClusterId | String | Path | Yes | c61da77e8bfbc4c4c999af2b51b65**** | The cluster ID. |
Object | Body | No | The request parameters. |
||
auto_scaling | Object | Body | No | The configuration of auto scaling. |
|
enable | Boolean | Body | Yes | true | Specifies whether to enable auto scaling for the node pool. Valid values:
Default value: |
max_instances | Long | Body | Yes | 10 | The maximum number of Elastic Compute Service (ECS) instances that can be created in the node pool. |
min_instances | Long | Body | Yes | 1 | The minimum number of ECS instances that must be kept in the node pool. |
type | String | Body | No | cpu | The instance types that can be used for the auto scaling of a node pool. Valid values:
Default value: |
is_bond_eip | Boolean | Body | No | true | This parameter is deprecated. Specifies whether to associate an elastic IP address (EIP) with the node pool. Valid values:
Default value: |
eip_internet_charge_type | String | Body | No | PayByBandwidth | This parameter is deprecated. The metering method of the EIP. Valid values:
Default value: |
eip_bandwidth | Long | Body | No | 5 | This parameter is deprecated. The maximum bandwidth of the EIP. Unit: Mbit/s. |
kubernetes_config | Object | Body | No | The configurations of the cluster. |
|
cms_enabled | Boolean | Body | No | true | 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: |
cpu_policy | String | Body | No | none | The CPU management policy of the nodes in the cluster. The following policies are supported if the Kubernetes version of the cluster is 1.12.6 or later.
Default value: |
labels | Array of tag | Body | No | The labels of the nodes in a node pool. You can add labels to the nodes in the cluster. |
|
runtime | String | Body | Yes | docker | The container runtime. |
runtime_version | String | Body | Yes | 19.03.5 | The version of the container runtime. |
taints | Array of taint | Body | No | The taints that you want to add to the nodes. |
|
user_data | String | Body | No | dGhpcyBpcyBhIGV4YW1wbGU= | The user-defined data on the node. |
node_name_mode | String | Body | No | customized,aliyun,ip,com | 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. |
nodepool_info | Object | Body | No | The configuration of the node pool. |
|
name | String | Body | Yes | cluster-demo | The name of a node pool. |
resource_group_id | String | Body | No | rg-acfmyvw3wjmb**** | The ID of the resource group to which the node pool belongs. |
type | String | Body | No | ess | The type of node pool. Valid values:
|
scaling_group | Object | Body | No | The configuration of the scaling group that is used by the node pool. |
|
auto_renew | Boolean | Body | No | true | Specifies whether to enable auto-renewal for nodes in the node pool. This parameter takes effect only when you set
Default value: |
auto_renew_period | Long | Body | No | 1 | The duration of the auto-renewal. This property takes effect and is required only when you set instance_charge_type to PrePaid and auto_renew to true. If Default value: 1. |
data_disks | Array of data_disk | Body | No | The configurations of the data disks that you want to attach to the nodes in the node pool. |
|
image_id | String | Body | No | aliyun_2_1903_x64_20G_alibase_20200529.vhd | The ID of a custom image. By default, the image provided by ACK is used. |
instance_charge_type | String | Body | Yes | PrePaid | The billing method of nodes in the node pool. Valid values:
Default value: |
instance_types | Array of String | Body | Yes | ecs.d1ne.2xlarge | The type of instance. |
key_pair | String | Body | No | np-key-name | The name of the key pair that is used to log on to nodes in the node pool. You must set this parameter or the Note You must set key_pair if the node pool is a managed node pool. |
login_password | String | Body | No | Hello1234 | The password for SSH logon. You must set this parameter or |
period | Long | Body | No | 1 | The subscription duration of the nodes in the node pool. This parameter takes effect and is required only when you set Default value: 1. |
period_unit | String | Body | No | Month | The billing cycle of the nodes in the node pool. This parameter is required if you set instance_charge_type to |
platform | String | Body | No | AliyunLinux | The release version of the operating system. Valid values:
Default value: |
rds_instances | Array of String | Body | No | rds-**** | The IDs of ApsaraDB RDS instances. |
spot_strategy | String | Body | No | NoSpot | The type of the preemptible instance. Valid values:
For more information, see Preemptible instances. |
spot_price_limit | Array | Body | No | The instance type for preemptible instances and the price limit of the instance type. |
|
instance_type | String | Body | No | ecs.c6.large | The instance type of preemptible instances. |
price_limit | String | Body | No | 0.39 | The price limit of a preemptible instance. |
scaling_policy | String | Body | No | release | The scaling mode of the scaling group. Valid values:
Default value: |
security_group_id | String | Body | No | sg-wz9a8g2mt6x5llu0**** | Specifies the ID of the security group to which you want to add the node pool. You must set this parameter or |
security_group_ids | Array of String | Body | No | sg-wz9a8g2mt6x5llu0**** | Specifies the IDs of security groups to which you want to add the node pool. You must set this parameter or |
system_disk_category | String | Body | Yes | cloud_efficiency | The type of system disk. Valid values:
Default value: |
system_disk_size | Long | Body | Yes | 120 | The system disk size of a node. Unit: GiB. Valid values: 40 to 500. |
system_disk_performance_level | String | Body | No | PL1 | The performance level (PL) of the system disk that you want to use for the node. This parameter takes effect only for ESSDs.
|
system_disk_provisioned_iops | Long | Body | No | 1000 | 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 |
system_disk_bursting_enabled | Boolean | Body | No | true | Specifies whether to enable the burst feature for system disks. Valid values:
This parameter is supported only when |
tags | Array | Body | 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 | Body | No | node-k-1 | The key of a label. |
value | String | Body | No | node-v-1 | The value of a label. |
vswitch_ids | Array of String | Body | Yes | vsw-wz9mfnhmssud6eicu**** | The IDs of vSwitches. |
multi_az_policy | String | Body | No | COST_OPTIMIZED | The ECS instance scaling policy for a multi-zone scaling group. Valid values:
Default value: |
on_demand_base_capacity | Long | Body | No | 0 | 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. |
on_demand_percentage_above_base_capacity | Long | Body | No | 20 | The percentage of pay-as-you-go instances among the extra instances that exceed the number specified by |
spot_instance_pools | Long | Body | No | 5 | 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. |
spot_instance_remedy | Boolean | Body | No | false | Specifies whether to supplement preemptible instances when the number of preemptible instances drops below the specified minimum number. If you set the value to true, Auto Scaling attempts to create a new preemptible instance when the system notifies that an existing preemptible instance is about to be reclaimed. Valid values:
|
compensate_with_on_demand | Boolean | Body | No | true | 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 cost or insufficient inventory. This parameter takes effect when you set
|
internet_charge_type | String | Body | No | PayByTraffic | The billing method of the public IP address. Valid values:
|
internet_max_bandwidth_out | Long | Body | No | 5 | The maximum outbound bandwidth of the public IP address of the node. Unit: Mbit/s. Valid values: 1 to 100. |
image_type | String | Body | No | AliyunLinux | The type of OS image. You must set this parameter or
|
deploymentset_id | String | Body | No | ds-bp1d19mmbsv3jf6xxxxx | The ID of the deployment set to which the ECS instances in the node pool belong. |
desired_size | Long | Body | No | 0 | The expected number of nodes in the node pool. |
private_pool_options | Object | Body | No | The configurations of the private node pool. |
|
id | String | Body | No | eap-bp67acfmxazb4**** | The ID of the private node pool. |
match_criteria | String | Body | No | Open | The type of private node pool. This parameter specifies the type of the 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:
|
tee_config | Object | Body | No | The configuration about confidential computing for the cluster. |
|
tee_enable | Boolean | Body | Yes | true | Specifies whether to enable confidential computing for the cluster. |
management | Object | Body | No | The configuration about the managed node pool feature. |
|
enable | Boolean | Body | Yes | false | Specifies whether to enable the managed node pool feature. Valid values:
|
auto_repair | Boolean | Body | No | false | Specifies whether to enable auto repair. This parameter takes effect only when you specify
|
upgrade_config | Object | Body | No | The configurations about auto upgrade. The configurations take effect only when you specify |
|
auto_upgrade | Boolean | Body | No | false | Specifies whether to enable auto update. Valid values:
|
surge | Long | Body | No | 0 | The number of additional nodes. |
surge_percentage | Long | Body | No | 0 | The percentage of additional nodes to the nodes in the node pool. You must set this parameter or |
max_unavailable | Long | Body | Yes | 1 | The maximum number of nodes that can be in the Unschedulable state. Valid values: 1 to 1000. Default value: 1. |
auto_repair_policy | Object | Body | No | The auto node repair policy. |
|
restart_node | Boolean | Body | No | true | Specifies whether ACK is allowed to automatically restart nodes after patching CVE vulnerabilities. Valid values:
|
auto_vul_fix | Boolean | Body | No | true | Specifies whether ACK is allowed to automatically patch CVE vulnerabilities. Valid values:
|
auto_vul_fix_policy | Object | Body | No | The auto CVE patching policy. |
|
restart_node | Boolean | Body | No | true | Specifies whether ACK is allowed to automatically restart nodes after patching CVE vulnerabilities. Valid values:
|
vul_level | String | Body | No | asap,nntf | The severity levels of vulnerabilities that ACK is allowed to automatically patch. Multiple severity levels are separated by commas (,). |
auto_upgrade | Boolean | Body | No | true | Specifies whether to enable auto update. Valid values:
|
auto_upgrade_policy | Object | Body | No | The auto update policy. |
|
auto_upgrade_kubelet | Boolean | Body | No | true | Specifies whether ACK is allowed to automatically update the kubelet. Valid values:
|
count | Long | Body | No | 1 | This parameter is deprecated. Use the desired_size parameter instead. The number of nodes in the node pool. |
interconnect_mode | String | Body | No | basic | The network type of the edge node pool. This parameter takes effect only when you set the
|
interconnect_config | Object | Body | No | This parameter is deprecated. The configuration of the edge node pool. |
|
cen_id | String | Body | No | cen-ey9k9nfhz0f******* | This parameter is deprecated. The ID of the Cloud Enterprise Network (CEN) instance that is associated with the enhanced edge node pool. |
ccn_id | String | Body | No | ccn-qm5i0i0q9yi******* | This parameter is deprecated. The ID of the Cloud Connect Network (CCN) instance that is associated with the enhanced edge node pool. |
ccn_region_id | String | Body | No | cn-shanghai | This parameter is deprecated. The region to which the CCN instance that is associated with the enhanced edge node pool belongs. |
bandwidth | Long | Body | No | 10 | This parameter is deprecated. The bandwidth of the enhanced edge node pool. Unit: Mbit/s. |
improved_period | String | Body | No | 1 | This parameter is deprecated. The subscription duration of the enhanced edge node pool. The duration is measured in months. |
max_nodes | Long | Body | No | 10 | 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 whose types are ess or default edge node pools. |
Response parameters
Parameter |
Type |
Example |
Description |
nodepool_id | String | np31da1b38983f4511b490fc62108a**** | The ID of the node pool that is created. |
task_id | String | T-613b19bbd160ad492800**** | The task ID. |
Examples
Sample requests
POST /clusters/c61da77e8bfbc4c4c999af2b51b65****/nodepools HTTP/1.1
Host:cs.aliyuncs.com
Content-Type:application/json
{
"auto_scaling" : {
"enable" : true,
"max_instances" : 10,
"min_instances" : 1,
"type" : "cpu",
"is_bond_eip" : true,
"eip_internet_charge_type" : "PayByBandwidth",
"eip_bandwidth" : 5
},
"kubernetes_config" : {
"cms_enabled" : true,
"cpu_policy" : "none",
"labels" : [ {
"key" : "env",
"value" : "prod"
} ],
"runtime" : "docker",
"runtime_version" : "19.03.5",
"taints" : [ {
"key" : "key",
"value" : "value",
"effect" : "NoSchedule"
} ],
"user_data" : "dGhpcyBpcyBhIGV4YW1wbGU=",
"node_name_mode" : "aliyun.com00055test"
},
"nodepool_info" : {
"name" : "cluster-demo",
"resource_group_id" : "rg-acfmyvw3wjmb****",
"type" : "ess"
},
"scaling_group" : {
"auto_renew" : true,
"auto_renew_period" : 1,
"data_disks" : [ {
"category" : "cloud_ssd",
"size" : 40,
"encrypted" : "true",
"auto_snapshot_policy_id" : "sp-2zej1nogjvovnz4z****",
"performance_level" : "PL1"
} ],
"image_id" : "aliyun_2_1903_x64_20G_alibase_20200529.vhd",
"instance_charge_type" : "PrePaid",
"instance_types" : [ "ecs.d1ne.2xlarge" ],
"key_pair" : "np-key-name",
"login_password" : "Hello1234",
"period" : 1,
"period_unit" : "Month",
"platform" : "AliyunLinux",
"rds_instances" : [ "rds-****" ],
"spot_strategy" : "NoSpot",
"spot_price_limit" : [ {
"instance_type" : "ecs.c6.large",
"price_limit" : "0.39"
} ],
"scaling_policy" : "release",
"security_group_id" : "sg-wz9a8g2mt6x5llu0****",
"security_group_ids" : [ "sg-wz9a8g2mt6x5llu0****" ],
"system_disk_category" : "cloud_efficiency",
"system_disk_size" : 120,
"system_disk_performance_level" : "PL1",
"tags" : [ {
"key" : "node-k-1",
"value" : "node-v-1"
} ],
"vswitch_ids" : [ "vsw-wz9mfnhmssud6eicu****" ],
"multi_az_policy" : "COST_OPTIMIZED",
"on_demand_base_capacity" : 0,
"on_demand_percentage_above_base_capacity" : 20,
"spot_instance_pools" : 5,
"spot_instance_remedy" : false,
"compensate_with_on_demand" : true,
"internet_charge_type" : "PayByTraffic",
"internet_max_bandwidth_out" : 5,
"image_type" : "AliyunLinux",
"deploymentset_id" : "ds-bp1d19mmbsv3jf6xxxxx",
"desired_size" : 0
},
"tee_config" : {
"tee_enable" : true
},
"management" : {
"enable" : false,
"auto_repair" : false,
"upgrade_config" : {
"auto_upgrade" : false,
"surge" : 0,
"surge_percentage" : 0,
"max_unavailable" : 1
}
},
"count" : 1,
"interconnect_mode" : "basic",
"interconnect_config" : {
"cen_id" : "cen-ey9k9nfhz0f*******",
"ccn_id" : "ccn-qm5i0i0q9yi*******",
"ccn_region_id" : "cn-shanghai",
"bandwidth" : 10,
"improved_period" : "1"
},
"max_nodes" : 10
}
Description of the sample requests
Create a node pool that has auto scaling enabled:
{
"ClusterId":"c61da77e8bfbc4c4c999af2b51b65****",
"nodepool_info":{
"name":"autoScale-demo",
"resource_group_id":"rg-acfmyvw3wjm****"
},
"scaling_group":{
"vswitch_ids":[
"vsw-wz9mfnhmssud6eic****"
],
"system_disk_category":"cloud_efficiency",
"system_disk_size":120,
"data_disks":[
],
"instance_types":[
"ecs.t6-c1m2.large"
],
"vpc_id":"vpc-wz984yvbd6lck22z3****",
"tags":[
],
"instance_charge_type":"PostPaid",
"login_password":"****",
"platform":"AliyunLinux",
"image_id":"aliyun_2_1903_x64_20G_alibase_20200529.vhd",
"rds_instances":[
],
"scaling_policy":"release"
},
"kubernetes_config":{
"cpu_policy":"none",
"cms_enabled":false,
"labels":[
{
"key":"workload_type",
"value":"cpu"
}
],
"taints":[
],
"user_data":"",
"runtime":"docker",
"runtime_version":"19.03.5"
},
"tee_config":{
"tee_enable":true
},
"auto_scaling":{
"enable":true,
"max_instances":10,
"min_instances":1,
"type":"cpu"
}
}
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateClusterNodePoolResponse>
<nodepool_id>np31da1b38983f4511b490fc62108a****</nodepool_id>
</CreateClusterNodePoolResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"nodepool_id" : "np31da1b38983f4511b490fc62108a****"
}
Error codes
For a list of error codes, see Service error codes.