You can call the DeleteClusterNodes operation to remove worker nodes from a Kubernetes cluster.

Note
  • When you remove a node, pods running on the node will be migrated to other nodes, which may cause service interruptions. We recommend that you remove nodes during off-peak hours.
  • Unexpected errors may occur when you remove a node. We recommend that you back up your data in advance.
  • The node that you choose to remove will be set to the unschedulable state.
  • You can remove worker nodes only.

Request information

Request line

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

Request parameters

Parameter Type Required Description
cluster_id string Yes The ID of the cluster from which you want to remove nodes.

Custom request headers

None. For more information, see Public request headers.

Request body

{ "nodes": "names of nodes that you want to remove in an array", "release_node": "whether to release corresponding ECS instances when nodes are removed" }

Request body parameters

Parameter Type Required Description
nodes Array Yes The nodes that you want to remove.
release_node bool No Whether to release corresponding ECS instances when nodes are removed. By default, ECS instances are not released.

Response information

Response line

HTTP/1.1 202 OK

Custom response headers

None. For more information, see Public response headers.

Examples

Sample requests

POST /clusters/Cccfd68c474454665ace07efce924****/attach HTTP/1.1
<Common request headers> {    "password": "Hello1234",
    "nodes": [
        "i-2ze74qyw9s3ge4k0****",
        "i-2zeipuf9l4tj659q****"
    ]
}

Sample responses

HTTP/1.1 202 Accepted
<Common response headers>