You can call the RemoveNodePoolNodes operation to remove specified nodes from a node pool.

Note
  • When you remove a node, the pods that run on the node are migrated to other nodes. This may cause service interruptions. We recommend that you remove nodes during off-peak hours.
  • Unknown errors may occur when you remove nodes. Before you remove nodes, back up the data on the nodes.
  • Nodes remain in the Unschedulable state when they are being removed.
  • You can remove only worker nodes. You cannot remove control planes.
  • Subscription nodes are not released after they are removed, even if you set release_node to true. You need to release subscription nodes in the Elastic Compute Service (ECS) console.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only common request headers. For more information, refer to the documentation of common request parameters.

Request syntax

DELETE /clusters/{ClusterId}/nodepools/{NodepoolId}/nodes HTTP/1.1

Request parameters

Parameter Type Position Required Example Description
ClusterId String Path Yes c23421cfa74454bc8b37163fd19af****

The ID of the cluster that you want to manage.

NodepoolId String Path Yes np97de2cfb1ba042398dd8f5504c94****

The ID of the node pool that you want to manage.

release_node Boolean Query No true

Specifies whether to release the nodes after they are removed. Valid values:

  • true: releases the nodes after they are removed.
  • false: does not release the nodes after they are removed.
drain_node Boolean Query No true

Specifies whether to drain the nodes that you want to remove. Valid values:

  • true: drain the nodes that you want to remove.
  • false: does not drain the nodes that you want to remove.
nodes Array of String Query No cn-hangzhou.172.16.xxx.xxx

The names of the nodes to remove.

instance_ids Array of String Query No i-bp1c70fqbv1nlu9xxxxx

The IDs of the instances on which the nodes that you want to remove are deployed.

Response parameters

Parameter Type Example Description
request_id String A9891419-D125-4D89-AFCA-68846675E2F7

The request ID.

task_id String T-62a944794ee141074400****

The task ID.

Examples

Sample requests

DELETE /clusters/c23421cfa74454bc8b37163fd19af****/nodepools/np97de2cfb1ba042398dd8f5504c94****/nodes?release_node=true&drain_node=true&nodes=["cn-hangzhou.172.16.xxx.xxx"]&instance_ids=["i-bp1c70fqbv1nlu9xxxxx"] HTTP/1.1
Host:cs.aliyuncs.com
Content-Type:application/json

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<RemoveNodePoolNodesResponse>
    <request_id>A9891419-D125-4D89-AFCA-68846675E2F7</request_id>
    <task_id>T-62a944794ee141074400****</task_id>
</RemoveNodePoolNodesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "request_id" : "A9891419-D125-4D89-AFCA-68846675E2F7",
  "task_id" : "T-62a944794ee141074400****"
}

Error codes

For a list of error codes, see Service error codes.