Skip to main content

Resize Kubernetes Cluster

POST/v1/clusters/{cluster_ident}/actions/resize

Changes the number of worker nodes in a cluster. The control plane is not resized by this call. The operation is asynchronous: the cluster stays in RESIZE_IN_PROGRESS until the workers are ready.

info

Request​

Parameters​

cluster_identstringrequiredpath

The UUID or name of the cluster.

node_countintegerrequiredbody

Target number of worker nodes. Default: 1.

nodes_to_removearraybody

Server IDs to remove when scaling down.

Sample Request​

curl -ks -X POST -H 'Content-Type: application/json' \
-H 'OpenStack-API-Version: container-infra 1.8' -H 'X-Auth-Token: gAAAAA<...>' \
-d '{"node_count": 2}' \
https://api.vietnix.cloud:9513/v1/clusters/{cluster_ident}/actions/resize

Response​

Status Code​

Success​

Status CodeDescription
202 - AcceptedThe resize was accepted and is being processed.

Error​

Status CodeDescription
401 - UnauthorizedUser must authenticate before making a request.
403 - ForbiddenPolicy does not allow current user to do this operation.
404 - Not FoundThe cluster does not exist.
409 - ConflictThe cluster is in a status that does not allow resizing.
note

Scale down one node at a time when the cluster runs stateful workloads. Removing several workers at once can drop replicas faster than the scheduler can rebuild them. Drain the nodes first, or pass nodes_to_remove explicitly.