Resize Kubernetes Cluster
POST
/v1/clusters/{cluster_ident}/actions/resizeChanges 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
Source: resize-a-cluster
Request
Parameters
cluster_identstringrequiredpathThe UUID or name of the cluster.
node_countintegerrequiredbodyTarget number of worker nodes. Default: 1.
nodes_to_removearraybodyServer 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 Code | Description |
|---|---|
| 202 - Accepted | The resize was accepted and is being processed. |
Error
| Status Code | Description |
|---|---|
| 401 - Unauthorized | User must authenticate before making a request. |
| 403 - Forbidden | Policy does not allow current user to do this operation. |
| 404 - Not Found | The cluster does not exist. |
| 409 - Conflict | The 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.