All Products
Search
Document Center

Container Service for Kubernetes:DeleteClusterNodes

Last Updated:May 30, 2025

Removes nodes from a Container Service for Kubernetes (ACK) cluster when they are no longer required through the DeleteClusterNodes interface. When removing nodes, you can specify whether to release the Elastic Compute Service (ECS) instances and drain the nodes.

Operation description

  • Use this API or the ACK console for node removal. Do not remove a node by running the kubectl delete node command.
  • Never directly release or remove ECS instances through the ECS or Auto Scaling console/APIs. Renew subscription ECS instances before they expire. Violations may cause node termination and removal from the ACK console.
  • If a node pool has the Expected Nodes parameter configured, the node pool automatically scales other ECS instances to maintain the expected number of nodes.
  • When you remove a node, the pods on the node are migrated to other nodes. To prevent service interruptions, remove nodes during off-peak hours. Unexpected risks may arise during node removal. Back up the data in advance.
  • ACK drains the node during node removal. Make sure that other nodes in the cluster have sufficient resources to host the evicted pods.
  • To ensure the pods on the node you want to remove can be successfully scheduled to other nodes, check whether the node affinity rules and scheduling policies of the pods meet the requirements.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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:DeleteClusterNodesdelete
*Cluster
acs:cs:{#regionId}:{#accountId}:cluster/{#ClusterId}
    none
none

Request syntax

POST /clusters/{ClusterId}/nodes HTTP/1.1 DELETE /clusters/{ClusterId}/nodes HTTP/1.1

POST /clusters/{ClusterId}/nodes HTTP/1.1 DELETE /clusters/{ClusterId}/nodes HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
ClusterIdstringYes

The cluster ID.

c850429a2287b4d968e27e87a4921****
bodyobjectNo

The request body.

drain_nodebooleanNo

Specifies whether to remove all pods from the nodes you want to remove. Valid values:

  • true: removes all pods automatically.
  • false: skips removing pods.

Default value: false

true
release_nodebooleanNo

Specifies whether to release the ECS instances. Valid values:

  • true: releases the ECS instances.
  • false: retains the ECS instances.

Default value: false

**

Notes Unsupported for subscription ECS instances.

true
nodesarrayYes

The list of nodes to remove. You must specify the node names used in the cluster, for example, cn-hangzhou.192.168.xx.xx.

stringNo

The node name.

cn-chengdu.192.168.0.70

Response parameters

ParameterTypeDescriptionExample
object

The response body.

cluster_idstring

The cluster ID.

c104d5d5f301c4e2a8ee578c37bc****
request_idstring

The request ID.

A9891419-D125-4D89-AFCA-68846675E2F7
task_idstring

The ID of the task.

T-60fea8ad2e277f0879000ae9

Examples

Sample success responses

JSONformat

{
  "cluster_id": "c104d5d5f301c4e2a8ee578c37bc****",
  "request_id": "A9891419-D125-4D89-AFCA-68846675E2F7",
  "task_id": "T-60fea8ad2e277f0879000ae9"
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history