Updated on 2026-04-30 GMT+08:00

Scaling a Node Pool

Function

This API is used to scale in or out a node pool.

The URL for cluster management is in the format of https://Endpoint/uri, where uri specifies the resource path for API access.

Calling Method

For details, see Calling APIs.

URI

POST /api/v3/projects/{project_id}/clusters/{cluster_id}/nodepools/{nodepool_id}/operation/scale

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Details:

Project ID. For details about how to obtain the value, see How to Obtain Parameters in the API URI.

Constraints:

None

Options:

Project IDs of the account

Default value:

N/A

cluster_id

Yes

String

Details:

Cluster ID. For details about how to obtain the value, see How to Obtain Parameters in the API URI.

Constraints:

None

Options:

Cluster IDs

Default value:

N/A

nodepool_id

Yes

String

Details:

Node pool ID. For details about how to obtain the ID, see How to Obtain Parameters in the API URI.

Constraints:

None

Options:

Cluster IDs

Default value:

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Definition

Type (or format) of the request body. The default value is application/json. Other values of this field will be provided for specific APIs, if any.

Constraints

GET requests are not validated.

Default Value

N/A

X-Auth-Token

Yes

String

Details:

Requests for calling an API can be authenticated using either a token or AK/SK. If token-based authentication is used, this parameter is mandatory and must be set to a user token. For details, see Obtaining a User Token.

Constraints:

None

Options:

N/A

Default value:

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

kind

Yes

String

Details:

API type

Constraints:

None

Options:

The value is fixed at NodePool.

Default value:

N/A

apiVersion

Yes

String

Details:

API version

Constraints:

None

Options:

The value is fixed at v3.

Default value:

N/A

spec

Yes

ScaleNodePoolSpec object

Details:

Parameters in the request for scaling a node pool

Constraints:

None

Table 4 ScaleNodePoolSpec

Parameter

Mandatory

Type

Description

desiredNodeCount

Yes

Integer

Definition

Desired total number of nodes in the node pool. During scale-out, it is the number of existing nodes plus the number of nodes to be added. During scale-in, it is the number of existing nodes minus the number of nodes to be removed.

Constraints

This parameter is mandatory. If it is omitted, the default value 0 is used. This will result in the deletion of all nodes in the node pool scaling group.

Range

0 or a positive integer

Default Value

0

scaleGroups

Yes

Array of strings

Definition

Name of a node pool's scaling group, which is obtained by calling the API for obtaining a specified node pool. The default scaling group name is default. An extended scaling group name can be obtained from the metadata name of extensionScaleGroups. You can select multiple scaling groups for scale-outs. CCE allocates newly added nodes evenly or at random across the AZs of the selected scaling groups. For a scale-in, only one scaling group can be specified.

Constraints

To use the default scaling group, set the parameter to default.

Range

N/A

Default Value

N/A

options

No

ScaleNodePoolOptions object

Details:

Configurations of node pool scaling options

Constraints:

None

Table 5 ScaleNodePoolOptions

Parameter

Mandatory

Type

Description

scalableChecking

No

String

Details:

Policy for checking the scale-out

Constraints:

None

Options:

  • instant: When a scale-out request is delivered, the system synchronously checks whether the underlying resources are sold out.

  • async: When a scale-out request is delivered, the system asynchronously checks whether the underlying resources are sold out.

Default value:

instant

scalePolicy

No

String

Definition

Scale-out policy. This parameter can be an empty string and is only valid when multiple scaleGroups values are transferred.

Constraints

N/A

Range

  • AZBalance: CCE attempts to balance the number of nodes in each AZ during a node pool scale-out. The flavor of each node is randomly specified in the selected scaling group. This policy simplifies configuration and reduces individual faults. It is suitable if there are no special requirements for node costs and AZs. Note: If resources in an AZ are insufficient, the nodes that should be added in this AZ will be added in other AZs, which may cause uneven node distribution among AZs. If this issue occurs, you can add nodes in this AZ again when the resources in the AZ are sufficient.

    NOTE:

    If ECS resources are sufficient, the following example illustrates a scale-out under the AZBalance policy. At the start, the cluster has five flavor1 nodes in AZ 1, five flavor2 nodes in AZ 1, and no flavor3 nodes in AZ 2. When 10 nodes are added, none are placed in AZ 1 and all 10 are placed in AZ 2, resulting in five flavor1 nodes in AZ 1, five flavor2 nodes in AZ 1, and 10 flavor3 nodes in AZ 2. When 20 nodes are added, five are placed in AZ 1 and 15 in AZ 2, resulting in seven or eight flavor1 nodes in AZ 1, eight or seven flavor2 nodes in AZ 1, and 15 flavor3 nodes in AZ 2.

  • Random: CCE randomly selects a scaling group from the scaleGroups list for scale-out.

Default Value

Random

Response Parameters

Status code: 202

Table 6 Response body parameters

Parameter

Type

Description

-

String

-

Example Requests

  • Scale out nodes in the default scaling group of a node pool (pay-per-use).

    {
      "kind" : "NodePool",
      "apiVersion" : "v3",
      "spec" : {
        "desiredNodeCount" : 1,
        "scaleGroups" : [ "default" ]
      }
    }

Example Responses

Status code: 202

The node pool scaling is accepted. Nodes in the node pool will be added or deleted based on the expected number of nodes in the node pool after scaling.

{
  "orderID" : "CS2504231542LJVS6"
}

Status Codes

Status Code

Description

202

The node pool scaling is accepted. Nodes in the node pool will be added or deleted based on the expected number of nodes in the node pool after scaling.

Error Codes

See Error Codes.