Updated on 2025-07-07 GMT+08:00

Synchronizing Node Configurations in a Node Pool

Function

This API is used to synchronize the configurations of existing nodes in 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.

URI

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

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

Details:

The request body type or format

Constraints:

The GET method is not verified.

Options:

  • application/json

  • application/json;charset=utf-8

  • application/x-pem-file

  • multipart/form-data (used when the FormData parameter is present)

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

spec

Yes

UpgradeNodePoolSpec object

Parameters in the request for synchronizing a node pool

Table 4 UpgradeNodePoolSpec

Parameter

Mandatory

Type

Description

maxUnavailable

Yes

Integer

Maximum number of nodes to be synchronized in each batch. The value ranges from 1 to 20. It specifies the maximum number of nodes that can be unavailable during node upgrade. Nodes will be unavailable during synchronization by resetting the nodes. Properly configure this parameter to prevent pod scheduling failures caused by too many unavailable nodes in the cluster.

nodeIDs

No

Array of strings

List of node IDs selected in the node pool to be synchronized. For details about how to obtain the IDs, see How to Obtain Parameters in the API URI.

nodePoolID

Yes

String

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

nodeTemplate

No

UpgradeNodePoolSpecNodeTemplate object

Parameters for synchronizing a node pool template

Table 5 UpgradeNodePoolSpecNodeTemplate

Parameter

Mandatory

Type

Description

lifeCycle

Yes

NodeLifecycleConfig object

Custom node lifecycle configuration

login

Yes

Login object

Details:

Node login mode. Either a key pair or password must be used for login.

Constraints:

None

Table 6 NodeLifecycleConfig

Parameter

Mandatory

Type

Description

preInstall

No

String

Pre-installation script. The characters of both the pre-installation and post-installation scripts are centrally calculated, and the total number of characters after transcoding cannot exceed 10,240.

The input value must be encoded using Base64. The method is as follows:

echo -n "*Content to be encoded*" | base64

postInstall

No

String

Post-installation script. The characters of both the pre-installation and post-installation scripts are centrally calculated, and the total number of characters after transcoding cannot exceed 10,240.

The input value must be encoded using Base64. The method is as follows:

echo -n "*Content to be encoded*" | base64
Table 7 Login

Parameter

Mandatory

Type

Description

sshKey

No

String

Details:

Name of the key pair used for login

Constraints:

None

Options:

N/A

Default value:

N/A

userPassword

No

UserPassword object

Details:

Password used for node login

Constraints:

None

Table 8 UserPassword

Parameter

Mandatory

Type

Description

username

No

String

Details:

Login account. The default value is root.

Constraints:

None

Options:

N/A

Default value:

root

password

Yes

String

Details:

Login password. If a username and password are used when a node is created, this field is shielded in the response body.

Constraints:

The password field must be salted during node creation. For details, see Adding a Salt in the password Field When Creating a Node.

Options:

A password must:

  • Contain 8 to 26 characters.

  • Contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters !@$%^-_=+[{}]:,./?

  • Not contain the username or the username spelled backwards.

Default value:

N/A

Response Parameters

Status code: 200

The node pool synchronization has been accepted.

None

Example Requests

  • Synchronize the node configurations in an on-premises node pool.

    {
      "spec" : {
        "maxUnavailable" : 1,
        "nodeIDs" : [ "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "bbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb" ],
        "nodePoolID" : "cccccccc-cccc-cccc-cccc-cccccccccccc"
      }
    }
  • Synchronize the node configurations in the default node pool.

    {
      "spec" : {
        "maxUnavailable" : 1,
        "nodeIDs" : [ "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "bbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb" ],
        "nodePoolID" : "DefaultPool",
        "nodeTemplate" : {
          "lifeCycle" : {
            "preInstall" : "ZWNobyAx",
            "postInstall" : "ZWNobyAx"
          },
          "login" : {
            "userPassword" : {
              "password" : "xxxxx",
              "username" : "root"
            }
          }
        }
      }
    }

Example Responses

None

Status Codes

Status Code

Description

200

The node pool synchronization has been accepted.

Error Codes

See Error Codes.