All Products
Search
Document Center

Container Service for Kubernetes:ModifyClusterNodePool

Last Updated:Nov 07, 2024

You can call the ModifyClusterNodePool operation to modify the configuration of a node pool with the specified node pool ID.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
cs:ModifyClusterNodePoolupdate
  • Cluster
    acs:cs:{#regionId}:{#accountId}:cluster/{#ClusterId}
    none
none

Request syntax

PUT /clusters/{ClusterId}/nodepools/{NodepoolId} HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
ClusterIdstringYes

The cluster ID.

c23421cfa74454bc8b37163fd19af****
NodepoolIdstringYes

The node pool ID.

p31da1b38983f4511b490fc62108a****
bodyobjectNo

The request body parameters.

nodepool_infoobjectNo

The configurations of the node pool.

namestringNo

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 (-).

default-nodepool
resource_group_idstringNo

The ID of the resource group.

rg-acfmyvw3wjm****
auto_scalingobjectNo

The configurations about auto scaling.

enablebooleanNo

Specifies whether to enable auto scaling. Valid values:

  • true: enables auto scaling for the node pool.
  • false: disables auto scaling for the node pool. If you set this parameter to false, other parameters in auto_scaling do not take effect.

Default value: false.

true
typedeprecatedstringNo

The instance type that is used for auto scaling. Valid values:

  • cpu: regular instance.
  • gpu: GPU-accelerated instance.
  • gpushare: shared GPU-accelerated instance.
  • spot: preemptible instance.

Default value: cpu.

cpu
max_instanceslongNo

The maximum number of Elastic Compute Service (ECS) instances that can be created in the node pool.

10
min_instanceslongNo

The minimum number of ECS instances that must be kept in the node pool.

2
is_bond_eipdeprecatedbooleanNo

Specifies whether to associate an elastic IP address (EIP) with the node pool. Valid values:

  • true: associates an EIP with the node pool.
  • false: No EIP is associated with the node pool.

Default value: false.

true
eip_internet_charge_typedeprecatedstringNo

The billing method of the EIP. Valid values:

  • PayByBandwidth: pay-by-bandwidth.
  • PayByTraffic: pay-by-data-transfer.

Default value: PayByBandwidth.

PayByBandwidth
eip_bandwidthdeprecatedlongNo

The maximum bandwidth of the EIP.

5
managementobjectNo

The configuration of the managed node pool feature.

enablebooleanNo

Specifies whether to enable the managed node pool feature. Valid values:

  • true: enables the managed node pool feature.
  • false: disables the managed node pool feature. Other parameters in this section take effect only when enable=true is specified.

Default value: false.

true
auto_repairbooleanNo

Specifies whether to enable auto repair. This parameter takes effect only when you specify enable=true. Valid values:

  • true: enables auto repair.
  • false: disables auto repair.

Default value: true.

true
auto_repair_policyobjectNo

The auto node repair policy.

restart_nodebooleanNo

Specifies whether ACK is allowed to automatically restart nodes after repairing the nodes. Valid values:

  • true: allows node restart.
  • false: does not allow node restart.
true
auto_vul_fixbooleanNo

Specifies whether ACK is allowed to automatically patch CVE vulnerabilities. Valid values:

  • true: enables auto CVE patching.
  • true: disables auto CVE patching.
true
auto_vul_fix_policyobjectNo

The auto CVE patching policy.

restart_nodebooleanNo

Specifies whether ACK is allowed to automatically restart nodes after repairing the nodes. Valid values:

  • true: allows node restart.
  • false: does not allow node restart.
true
vul_levelstringNo

The severity levels of vulnerabilities that ACK is allowed to automatically patch. Multiple severity levels are separated by commas (,).

asap,nntf
auto_upgradebooleanNo

Indicates whether auto update is enabled. Valid values:

  • true: enables auto update.
  • false: disables auto update.
true
auto_upgrade_policyobjectNo

The auto update policy.

auto_upgrade_kubeletbooleanNo

Specifies whether ACK is allowed to automatically update the kubelet. Valid values:

  • true: allows auto update of the kubelet.
  • false: does not allow auto update of the kubelet.
true
auto_upgrade_runtimebooleanNo

Specifies whether ACK is allowed to automatically update the runtime. This parameter takes effect only when you specify auto_upgrade=true. Valid values:

  • true: allows auto update of the runtime.
  • false: does not allow auto update of the runtime.

Default value: false.

auto_upgrade_osbooleanNo

Specifies whether ACK is allowed to automatically update the operating system. This parameter takes effect only when you specify auto_upgrade=true. Valid values:

  • true: allows auto update of the OS.
  • false: does not allow auto update of the OS.

Default value: false.

upgrade_configdeprecatedobjectNo

The configuration of auto update. The configuration takes effect only when enable=true is specified.

auto_upgradedeprecatedbooleanNo

Specifies whether to enable auto update.

  • true: enables auto update.
  • false: disables auto update.

Default value: true.

true
surgelongNo

The number of nodes that are temporarily added to the node pool during an auto upgrade. Additional nodes are used to host the workloads of nodes that are being updated.

Note We recommend that you set the number of additional nodes to a value that does not exceed the current number of existing nodes.
5
surge_percentagelongNo

The percentage of additional nodes to the nodes in the node pool. You must set this parameter or surge.

0
max_unavailablelongNo

The maximum number of nodes that can be in the Unavailable state.

Valid values: 1 to 1000.

Default value: 1.

1
scaling_groupobjectNo

The configuration of the scaling group.

vswitch_idsarrayNo

The IDs of vSwitches. You can specify 1 to 20 vSwitches.

Note To ensure high availability, we recommend that you select vSwitches that reside in different zones.
stringNo

The IDs of vSwitches.

vsw-wz9uwxhawmtzg7u9h****
instance_typesarrayNo

The instance types. You can specify multiple instance types. A node is assigned the instance type from the first instance type of the list until the node is created. The instance type that is used to create the node varies based on the actual instance stock.

stringNo

The type of the instance. For more information, see Overview of instance families.

ecs.c6.large
instance_charge_typestringNo

The billing method of nodes in the node pool. Valid values:

  • PrePaid: subscription.
  • PostPaid: pay-as-you-go.

Default value: PostPaid.

PostPaid
periodlongNo

The subscription duration of the nodes in the node pool. This parameter takes effect and is required only when you set instance_charge_type to PrePaid.

If PeriodUnit=Month is specified, the valid values are 1, 2, 3, 6, 12, 24, 36, 48, and 60.

1
period_unitstringNo

The billing cycle of the nodes in the node pool. This parameter is required if you set instance_charge_type to PrePaid. Valid values:

The billing cycle is measured only in months.

Default value: Month.

Month
auto_renewbooleanNo

Specifies whether to enable auto-renewal for the nodes in the node pool. This parameter takes effect only when you set instance_charge_type to PrePaid. Valid values:

  • true: enables auto-renewal.
  • false: disables auto-renewal.

Default value: false.

true
auto_renew_periodlongNo

The duration of the auto-renewal. This parameter takes effect and is required only when you set instance_charge_type to PrePaid.

If you specify PeriodUnit=Month, the valid values are 1, 2, 3, 6, and 12.

1
spot_strategystringNo

The bidding policy of preemptible instances. Valid values:

  • NoSpot: non-preemptible instance.
  • SpotWithPriceLimit: specifies the highest bid for the preemptible instance.
  • SpotAsPriceGo: automatically submits bids based on the up-to-date market price.

For more information, see Create a preemptible elastic container instance.

SpotWithPriceLimit
spot_price_limitarray<object>No

The instance type of preemptible instance and the price cap for the instance type.

objectNo

The instance type of preemptible instance and the price cap for the instance type.

instance_typestringNo

The price cap of a preemptible instance.

ecs.c6.large
price_limitstringNo

The maximum bid price of a preemptible instance.

Unit: USD/hour.

0.39
image_typestringNo

The type of OS distribution that you want to use. To specify the node OS, we recommend that you use this parameter. Valid values:

  • AliyunLinux: Alibaba Cloud Linux 2.
  • AliyunLinuxSecurity: Alibaba Cloud Linux 2 (UEFI).
  • AliyunLinux3: Alibaba Cloud Linux 3.
  • AliyunLinux3Arm64: Alibaba Cloud Linux 3 (ARM).
  • AliyunLinux3Security: Alibaba Cloud Linux 3 (UEFI).
  • CentOS: CentOS.
  • Windows: Windows.
  • WindowsCore: Windows Core.
  • ContainerOS: ContainerOS.
AliyunLinux
image_idstringNo

The custom image ID. You can call the DescribeKubernetesVersionMetadata operation to query the supported images. By default, the latest image is used.

aliyun_2_1903_x64_20G_alibase_20200904.vhd
system_disk_categorystringNo

The type of system disk. Valid values:

  • cloud_efficiency: ultra disk.
  • cloud_ssd: standard SSD

Default value: cloud_ssd.

cloud_efficiency
system_disk_categoriesarrayNo

The system disk types. The system attempts to create system disks of a disk type with a lower priority if the disk type with a higher priority is unavailable. Valid values: cloud: disk. cloud_efficiency (ultra disk), cloud_ssd: standard SSD. cloud_essd: Enterprise SSD (ESSD).

stringNo

The type of the system disk.

cloud_essd
system_disk_sizelongNo

The size of the system disk in 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.

Default value: the greater value between 40 and the image size.

120
system_disk_performance_levelstringNo

The performance level (PL) of the system disk that you want to use for the node. This parameter takes effect only for ESSDs. You can specify a higher PL if you increase the size of the data disk. For more information, see ESSDs .

PL1
system_disk_encryptedbooleanNo

Indicates whether the system disk is encrypted. Valid values: true: encrypts the system disk. false: does not encrypt the system disk.

false
system_disk_kms_key_idstringNo

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_algorithmstringNo

The encryption algorithm that is used by the system disk. The value is aes-256.

aes-256
system_disk_provisioned_iopslongNo

The predefined read and write IOPS of the system disk when the disk type is cloud_auto.

1000
system_disk_bursting_enabledbooleanNo

Specifies whether to enable Burst for the system disk when the disk type is cloud_auto.

true
data_disksarrayNo

The configurations of the data disks that are mounted to the nodes in the node pool. You can mount at most 10 data disks to the nodes in the node pool.

data_diskNo

The configuration of node data disks.

key_pairstringNo

The name of the key pair. You must specify this parameter or login_password. You must specify the key_pair parameter if the node pool is a managed node pool.

pro-nodepool
login_passwordstringNo

The password for SSH logon. You must specify this parameter or key_pair. The password must be 8 to 30 characters in length, and must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.

Hello1234
internet_charge_typestringNo

The metering method of the public IP address. Valid values:

  • PayByBandwidth: pay-by-bandwidth.
  • PayByTraffic: pay-by-data-transfer
PayByBandwidth
internet_max_bandwidth_outlongNo

The maximum outbound bandwidth of the public IP address of the node. Unit: Mbit/s. Valid values: 1 to 100.

5
tagsarrayNo

The tags 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://.

tagNo

The label to be added to the ECS instances.

desired_sizelongNo

The expected number of nodes in the node pool.

2
multi_az_policystringNo

The ECS instance scaling policy for the multi-zone scaling group. Valid values:

  • PRIORITY: The scaling group is scaled based on the VSwitchIds.N parameter. If an ECS instance cannot be created in the zone in which the vSwitch that has the highest priority resides, Auto Scaling creates the ECS instance in the zone in which the vSwitch that has the next highest priority resides.

  • COST_OPTIMIZED: ECS instances are created based on the vCPU unit price in ascending order. Preemptible instances are preferably created when preemptible instance types are specified in the scaling configurations. You can specify CompensateWithOnDemand to specify whether to automatically create pay-as-you-go instances when preemptible instances cannot be created due to insufficient resources.

    **

    Note COST_OPTIMIZED is valid only when multiple instance types are specified or at least one preemptible instance type is specified.

  • BALANCE: ECS instances are evenly distributed across multiple zones specified by the scaling group. If ECS instances become imbalanced among multiple zones due to the insufficient inventory, you can call the RebalanceInstances operation of Auto Scaling to balance the instance distribution among zones. For more information, see RebalanceInstances .

Default value: PRIORITY.

BALANCE
scaling_policystringNo

The scaling mode of the scaling group. Valid values:

  • release: the standard mode. ECS instances are created and released based on resource usage.
  • recycle: the swift mode. ECS instances are created, stopped, or started during scaling events. This reduces the time required for the next scale-out event. When the instance is stopped, you are charged only for the storage service. This does not apply to ECS instances that are attached to local disks.
release
on_demand_base_capacitylongNo

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 smaller than the value of this parameter, Auto Scaling preferably creates pay-as-you-go instances.

0
on_demand_percentage_above_base_capacitylongNo

The percentage of pay-as-you-go instances among the extra instances that exceed the number specified by on_demand_base_capacity. Valid values: 0 to 100.

20
spot_instance_poolslongNo

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_remedybooleanNo

Specifies whether to supplement preemptible instances. If the supplementation of preemptible instances is enabled, 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:

  • true: supplements preemptible instances.
  • false: does not supplement preemptible instances.
false
compensate_with_on_demandbooleanNo

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 only when you set multi_az_policy to COST_OPTIMIZED. Valid values:

  • true: automatically creates pay-as-you-go instances to meet the required number of ECS instances if preemptible instances cannot be created.
  • false: does not create pay-as-you-go instances to meet the required number of ECS instances if preemptible instances cannot be created.
true
rds_instancesarrayNo

The ApsaraDB RDS instances.

stringNo

The ID of the ApsaraDB RDS for MySQL instance. After you specify the list of ApsaraDB RDS instances, the ECS instances in the cluster are automatically added to the whitelist of the ApsaraDB RDS instances.

rds-xxx
private_pool_optionsobjectNo

The configuration of the private node pool.

idstringNo

The private node pool ID.

eap-bp67acfmxazb4****
match_criteriastringNo

The type of private node pool. This parameter specifies the type of private node 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: open private node pool. The system selects an open private pool to start instances. If no matching open private pools are available, the resources in the public pool are used.
  • Target: private node pool. The system uses the resources of the specified private pool to start instances. If the specified private pool is unavailable, instances cannot be started.
  • None: does not use private pools. The resources of private node pools are not used to launch instances.
Open
platformdeprecatedstringNo

The OS platform. Valid values:

  • AliyunLinux
  • CentOS
  • Windows
  • WindowsCore
AliyunLinux
instance_patternsarrayNo

The instance attributes.

instance_patternsNo

The instance attributes.

kubernetes_configobjectNo

The configurations of the cluster in which the node pool is deployed.

labelsarrayNo

The labels of the nodes in the node pool. You can add labels to the nodes in the cluster. You must add labels based on the following rules:

  • A label is a case-sensitive key-value pair. You can add up to 20 labels.
  • The key must be unique and cannot exceed 64 characters in length. The value can be empty and cannot exceed 128 characters in length. Keys and values cannot start with aliyun, acs:, https://, or http://. For more information, see Labels and Selectors.
tagNo

The node label.

taintsarrayNo

The configuration of a node taint.

taintNo

The configuration of a node taint.

runtimestringNo

The name of the container runtime.

docker
runtime_versionstringNo

The version of the container runtime.

19.03.5
cpu_policystringNo

The CPU management policy of nodes. The following policies are supported if the Kubernetes version of the cluster is 1.12.6 or later:

  • static: allows pods with specific resource characteristics on the node to be granted with enhanced CPU affinity and exclusivity.
  • none: specifies that the default CPU affinity is used.

Default value: none.

none
unschedulablebooleanNo

Specifies whether the nodes are unschedulable after a scale-out activity is performed.

false
user_datastringNo

The user-defined script that is executed after nodes are initialized. For more information, see Prepare user data.

IyEvdXNyL2Jpbi9iYXNoCmVjaG8gIkhlbGxvIEFDSyEi
cms_enabledbooleanNo

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:

  • true: installs the CloudMonitor agent on ECS nodes.
  • false: does not install the CloudMonitor agent on ECS nodes.

Default value: false.

true
pre_user_datastringNo

The user-defined script that is executed before nodes are initialized. For more information, see Prepare user data.

IyEvdXNyL2Jpbi9iYXNoCmVjaG8gIkhlbGxvIEFDSyEi
tee_configobjectNo

The configurations about confidential computing for the cluster.

tee_enablebooleanNo

Specifies whether to enable confidential computing for the cluster. Valid values:

  • true: enables confidential computing for the cluster.
  • false: disables confidential computing for the cluster.

Default value: false.

false
update_nodesbooleanNo

Specifies whether to update node information, such as labels and taints.

true
concurrencybooleanNo

Specifies whether concurrency is supported.

true

Response parameters

ParameterTypeDescriptionExample
object

The response body.

task_idstring

The task ID.

T-5fd211e924e1d00787000293
nodepool_idstring

The node pool ID.

np737c3ac1ac684703b9e10673aa2c****
request_idstring

The ID of the request.

687C5BAA-D103-4993-884B-C35E4314****

Examples

Sample success responses

JSONformat

{
  "task_id": "T-5fd211e924e1d00787000293",
  "nodepool_id": "np737c3ac1ac684703b9e10673aa2c****",
  "request_id": "687C5BAA-D103-4993-884B-C35E4314****"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-09-27The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-06-13The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-06-13The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-04-19The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-01-19The response structure of the API has changedView Change Details
2023-12-15The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-12-13The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-10-17The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-08-30The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-08-10The internal configuration of the API is changed, but the call is not affectedView Change Details
2020-09-23The internal configuration of the API is changed, but the call is not affectedView Change Details