You can call the ModifyClusterNodePool operation to modify the configuration of a node pool.
Debugging
Request syntax
PUT /clusters/ClusterId/nodepools/NodepoolId HTTP/1.1
Content-Type:application/json
{
"auto_scaling" : {
"eip_bandwidth" : Long,
"eip_internet_charge_type" : "String",
"enable" : Boolean,
"is_bond_eip" : Boolean,
"max_instances" : Long,
"min_instances" : Long,
"type" : "String"
},
"kubernetes_config" : {
"cms_enabled" : Boolean,
"cpu_policy" : "String",
"labels" : [ {
"key" : "String",
"value" : "String"
} ],
"runtime" : "String",
"runtime_version" : "String",
"taints" : [ {
"key" : "String",
"value" : "String",
"effect" : "String"
} ],
"user_data" : "String"
},
"nodepool_info" : {
"name" : "String",
"resource_group_id" : "String"
},
"scaling_group" : {
"data_disks" : [ {
"category" : "String",
"size" : Long,
"encrypted" : "String",
"auto_snapshot_policy_id" : "String"
} ],
"instance_charge_type" : "String",
"period" : Long,
"period_unit" : "String",
"auto_renew" : Boolean,
"auto_renew_period" : Long,
"platform" : "String",
"image_id" : "String",
"spot_strategy" : "String",
"spot_price_limit" : [ {
"instance_type" : "String",
"price_limit" : "String"
} ],
"instance_types" : [ "String" ],
"key_pair" : "String",
"login_password" : "String",
"rds_instances" : [ "String" ],
"scaling_policy" : "String",
"system_disk_category" : "String",
"system_disk_size" : Long,
"tags" : [ {
"key" : "String",
"value" : "String"
} ],
"vswitch_ids" : [ "String" ],
"multi_az_policy" : "String",
"on_demand_base_capacity" : Long,
"on_demand_percentage_above_base_capacity" : Long,
"spot_instance_pools" : Long,
"spot_instance_remedy" : Boolean,
"compensate_with_on_demand" : Boolean
},
"tee_config" : {
"tee_enable" : Boolean
},
"management" : {
"enable" : Boolean,
"auto_repair" : Boolean,
"upgrade_config" : {
"auto_upgrade" : Boolean,
"surge" : Long,
"surge_percentage" : Long,
"max_unavailable" : Long
}
},
"update_nodes" : Boolean
}
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
ClusterId | String | Yes | c23421cfa74454bc8b37163fd19af**** |
The ID of the cluster that you want to manage. |
NodepoolId | String | Yes | p31da1b38983f4511b490fc62108a**** |
The ID of the node pool that you want to manage. |
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
auto_scaling | Object | No |
The configuration about auto scaling. |
|
eip_bandwidth | Long | No | 5 |
The peak bandwidth of the elastic IP address (EIP). |
eip_internet_charge_type | String | No | PayByBandwidth |
The billing method of the EIP. Valid values:
Default value: |
enable | Boolean | No | true |
Specifies whether to enable auto scaling.
Default value: |
is_bond_eip | Boolean | No | true |
Specifies whether to associate an EIP with the node pool. Valid values:
Default value: |
max_instances | Long | No | 10 |
The maximum number of Elastic Compute Service (ECS) instances that can be created in the node pool. |
min_instances | Long | No | 2 |
The minimum number of ECS instances that must be kept in the node pool. |
type | String | No | cpu |
The instance types that can be used for the auto scaling of the node pool. Valid values:
Default value: |
kubernetes_config | Object | No |
The configuration about the cluster. |
|
cms_enabled | Boolean | 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 | 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 | No |
The labels that you want to add to the nodes in the cluster. You must add labels based on the following rules:
|
|
runtime | String | No | docker |
The name of the container runtime. |
runtime_version | String | No | 19.03.5 |
The version of the container runtime. |
taints | Array of taint | No |
The configurations of node taints. |
|
user_data | String | No | IyEvdXNyL2Jpbi9iYXNoCmVjaG8gIkhlbGxvIEFDSyEi |
The user-defined data of the node pool. For more information, see Prepare user data. |
nodepool_info | Object | No |
The configuration of the node pool. |
|
name | String | No | default-nodepool |
The name of the node pool. The name must be 1 to 63 characters in length, and can contain digits, letters, and hyphens (-). It cannot start with a hyphen (-). |
resource_group_id | String | No | rg-acfmyvw3wjm**** |
The ID of the resource group. |
scaling_group | Object | No |
The configuration of the scaling group. |
|
data_disks | Array of data_disk | No |
The configurations of the data disks that are mounted to the nodes in the node pool. You can mount 0 to 10 data disks. You can mount at most 10 data disks to the nodes in the node pool. |
|
instance_charge_type | String | No | PostPaid |
The billing method of the nodes in the node pool. Valid values:
Default value: |
period | Long | No | 1 |
The subscription duration of the nodes in the node pool. This parameter takes effect
and is required only when you set If you specify |
period_unit | String | No | Month |
The billing cycle of the nodes in the node pool. This parameter is required if you
set The billing cycle is measured only in months. Default value: |
auto_renew | Boolean | No | true |
Specifies whether to enable auto-renewal for the nodes in the node pool. This parameter
takes effect only when you set
Default value: |
auto_renew_period | Long | No | 1 |
The duration of the auto-renewal. This parameter takes effect and is required only
when you set If you specify |
platform | String | No | AliyunLinux |
The OS platform. Valid values:
|
image_id | String | No | aliyun_2_1903_x64_20G_alibase_20200904.vhd |
The ID of the custom image. You can call the |
spot_strategy | String | No | SpotWithPriceLimit |
The type of the preemptible instance. Valid values:
For more information, see Preemptible instances. |
spot_price_limit | Array | No |
The bid configurations of preemptible instances. |
|
instance_type | String | No | ecs.c6.large |
The instance type of preemptible instances. |
price_limit | String | No | 0.39 |
The maximum bid price of a preemptible instance. Unit: CNY/hour. |
instance_types | Array of String | No | ecs.c6.large |
The instance types. For more information, see Instance families. |
key_pair | String | No | pro-nodepool |
The name of the key pair. You must set this parameter or the |
login_password | String | No | Hello1234 |
The password for SSH logon. You must set this parameter or the |
rds_instances | Array of String | No | rds-xxx |
The IDs of ApsaraDB RDS instances. After you specify the list of RDS instances, the ECS instances in the cluster are automatically added to the whitelist of the RDS instances. |
scaling_policy | String | No | release |
The scaling mode of the scaling group. Valid values:
|
system_disk_category | String | No | cloud_efficiency |
The type of system disk. Valid values:
Default value: |
system_disk_size | Long | No | 120 |
The system disk size of a node. Unit: GiB. Valid values: 20 to 500 The value of this parameter must be at least 20 and greater than or equal to the image size. The default value is the greater one between 40 and the image size. |
system_disk_performance_level | String | No | PL1 |
The performance level (PL) of the system disk that you want to use for the node. This parameter takes effect only for enhanced SSDs. You can specify a higher PL if you increase the size of the system disk. For more information, see Enhanced SSDs. |
tags | Array of tag | No |
The labels that you want to add to the ECS instances. A 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://. |
|
vswitch_ids | Array of String | No | vsw-wz9uwxhawmtzg7u9h**** |
The IDs of vSwitches. |
multi_az_policy | String | No | BALANCE |
The ECS instance scaling policy for a multi-zone scaling group. Valid values:
Default value: |
on_demand_base_capacity | Long | 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 | No | 20 |
The percentage of pay-as-you-go instances among the extra instances that exceed the
number specified by |
spot_instance_pools | Long | 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 | No | false |
Specifies whether to supplement preemptible instances. 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 to about to be reclaimed. Valid values:
|
compensate_with_on_demand | Boolean | 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 the cost or insufficient inventory. This parameter takes effect when
|
internet_charge_type | String | No | PayByBandwidth |
The billing method of the public IP address. Valid values:
|
internet_max_bandwidth_out | Long | No | 5 |
The maximum outbound bandwidth of the public IP address of the node. Unit: Mbit/s. Valid values: 1 to 100. |
desired_size | Long | No | 2 |
The expected number of nodes in the node pool. |
tee_config | Object | No |
The configuration about confidential computing for the cluster. |
|
tee_enable | Boolean | No | false |
Specifies whether to enable confidential computing for the cluster.
Default value: |
management | Object | No |
The configuration about the managed node pool feature. |
|
enable | Boolean | No | true |
Specifies whether to enable the managed node pool feature. Valid values:
Default value: |
auto_repair | Boolean | No | true |
Specifies whether to enable auto repair. This parameter takes effect only when you
specify
Default value: |
upgrade_config | Object | No |
The configuration about auto upgrade. The configuration takes effect only when specify
|
|
auto_upgrade | Boolean | No | true |
Specifies whether to enable auto upgrade.
Default value: |
surge | Long | No | 5 |
The number of additional nodes. Additional nodes are used to host the workloads of nodes that are being upgraded. Note We recommend that you specify the number of additional nodes to a value smaller than
the number of existing nodes in the node pool.
|
surge_percentage | Long | No | 0 |
The percentage of additional nodes to the nodes in the node pool. You must set this
parameter or |
max_unavailable | Long | No | 1 |
The maximum number of nodes that can be in the Unschedulable state. Valid values: 1 to 1000 Default value: 1 |
update_nodes | Boolean | No | true |
Specifies whether to update node information, such as labels and taints. |
Response syntax
HTTP/1.1 200
Content-Type:application/json
{
"task_id" : "String",
"nodepool_id" : "String"
}
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
task_id | String | T-5fd211e924e1d00787000293 |
The ID of the task. |
nodepool_id | String | np737c3ac1ac684703b9e10673aa2c**** |
The ID of the node pool. |
Examples
Sample requests
PUT /clusters/c23421cfa74454bc8b37163fd19af****/nodepools/p31da1b38983f4511b490fc62108a**** HTTP/1.1
Content-Type:application/json
{
"auto_scaling" : {
"eip_bandwidth" : 5,
"eip_internet_charge_type" : "PayByBandwidth",
"enable" : true,
"is_bond_eip" : true,
"max_instances" : 10,
"min_instances" : 2,
"type" : "cpu"
},
"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" : "IyEvdXNyL2Jpbi9iYXNoCmVjaG8gIkhlbGxvIEFDSyEi"
},
"nodepool_info" : {
"name" : "default-nodepool",
"resource_group_id" : "rg-acfmyvw3wjm****"
},
"scaling_group" : {
"data_disks" : [ {
"category" : "cloud_ssd",
"size" : 40,
"encrypted" : "true",
"auto_snapshot_policy_id" : "sp-2zej1nogjvovnz4z****"
} ],
"instance_charge_type" : "PostPaid",
"period" : 1,
"period_unit" : "Month",
"auto_renew" : true,
"auto_renew_period" : 1,
"platform" : "AliyunLinux",
"image_id" : "aliyun_2_1903_x64_20G_alibase_20200904.vhd",
"spot_strategy" : "SpotWithPriceLimit",
"spot_price_limit" : [ {
"instance_type" : "ecs.c6.large",
"price_limit" : "0.39"
} ],
"instance_types" : [ "ecs.c6.large" ],
"key_pair" : "pro-nodepool",
"login_password" : "Hello1234",
"rds_instances" : [ "rds-xxx" ],
"scaling_policy" : "release",
"system_disk_category" : "cloud_efficiency",
"system_disk_size" : 120,
"tags" : [ {
"key" : "env",
"value" : "prod"
} ],
"vswitch_ids" : [ "vsw-wz9uwxhawmtzg7u9h****" ],
"multi_az_policy" : "BALANCE",
"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
},
"tee_config" : {
"tee_enable" : false
},
"management" : {
"enable" : true,
"auto_repair" : true,
"upgrade_config" : {
"auto_upgrade" : true,
"surge" : 5,
"surge_percentage" : 0,
"max_unavailable" : 1
}
},
"update_nodes" : true
}
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<task_id>T-5fd211e924e1d00787000293</task_id>
<nodepool_id>np737c3ac1ac684703b9e10673aa2c****</nodepool_id>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"task_id" : "T-5fd211e924e1d00787000293",
"nodepool_id" : "np737c3ac1ac684703b9e10673aa2c****"
}
Error codes
For a list of error codes, visit the API Error Center.