All Products
Search
Document Center

Container Service for Kubernetes:DeleteClusterNodes

Last Updated:Aug 28, 2026

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.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cs:DeleteClusterNodes

delete

*Cluster

acs:cs:{#regionId}:{#accountId}:cluster/{#ClusterId}

None None

Request syntax

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

Path Parameters

Parameter

Type

Required

Description

Example

ClusterId

string

Yes

The cluster ID.

c850429a2287b4d968e27e87a4921****

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

drain_node

boolean

No

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

false

release_node

boolean

No

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

nodes

array

Yes

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

string

No

The node name.

cn-hangzhou.192.168.xx.xx

Response elements

Element

Type

Description

Example

object

The response body.

cluster_id

string

The cluster ID.

c104d5d5f301c4e2a8ee578c37******

request_id

string

The request ID.

A9891419-D125-4D89-AFCA-688466******

task_id

string

The ID of the task.

T-60fea8ad2e27000ae9******

Examples

Success response

JSON format

{
  "cluster_id": "c104d5d5f301c4e2a8ee578c37******",
  "request_id": "A9891419-D125-4D89-AFCA-688466******",
  "task_id": "T-60fea8ad2e27000ae9******"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.