Removes nodes from a node pool in a cluster and adjusts the expected number of nodes when the nodes are no longer needed. When removing nodes, you can specify whether to release the ECS instances and whether to automatically drain the nodes. Removing nodes involves pod migration, which may affect your services. Perform this operation during off-peak hours and back up your data in advance.
Operation description
Removing nodes involves pod migration, which may affect your services. Perform this operation during off-peak hours.
Unexpected risks may occur during the operation. Back up your data in advance.
During the operation, the system sets the current nodes to the unschedulable state.
Only worker nodes are removed. Master nodes are not removed.
Even if you choose to release nodes (nodes with
release_nodeset totrue), subscription nodes are not released. You must release them in the ECS console after removing the nodes.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cs:RemoveNodePoolNodes |
update |
*Cluster
|
None | None |
Request syntax
DELETE /clusters/{ClusterId}/nodepools/{NodepoolId}/nodes HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClusterId |
string |
Yes |
The cluster ID. |
c23421cfa74454bc8b37163fd19af**** |
| NodepoolId |
string |
Yes |
The node pool ID. |
np97de2cfb1ba042398dd8f5504c94**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| release_node |
boolean |
No |
Specifies whether automatic release the nodes. Valid values:
Removing nodes does not automatically release subscription nodes. Automatic release subscription nodes, refer to Change the billing method of an instance from subscription to pay-as-you-go to change the billing method of the nodes to pay-as-you-go, and then log on to the ECS console automatic release them. |
true |
| drain_node |
boolean |
No |
Specifies whether to drain the nodes. Valid values:
|
true |
nodes
deprecated
|
array |
No |
[Deprecated] The list of nodes to be removed. danger This parameter is deprecated. Use instance_ids instead. |
|
|
string |
No |
The node name. |
cn-hangzhou.172.16.xxx.xxx |
|
| instance_ids |
array |
No |
The list of instances to be removed. |
|
|
string |
No |
The instance ID to be removed. |
i-bp1c70fqbv1nlu9xxxxx |
|
| concurrency |
boolean |
No |
Specifies whether to remove nodes concurrently.
Default value: false. |
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
||
| request_id |
string |
The request ID. |
A9891419-D125-4D89-AFCA-68846675**** |
| task_id |
string |
The task ID. |
T-62a944794ee141074400**** |
Examples
Success response
JSON format
{
"request_id": "A9891419-D125-4D89-AFCA-68846675****",
"task_id": "T-62a944794ee141074400****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.