Synchronizing Node Pools
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/:projectid/clusters/{cluster_id}/nodepools/{nodepool_id}/operation/upgrade
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the value, see How to Obtain Parameters in the API URI. |
cluster_id |
Yes |
String |
Cluster ID. For details about how to obtain the value, see How to Obtain Parameters in the API URI. |
nodepool_id |
Yes |
String |
Node pool ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
Yes |
String |
Message body type (format). |
X-Auth-Token |
Yes |
String |
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. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
spec |
Yes |
UpgradeNodePoolSpec object |
Parameters in the request for synchronizing a node pool |
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 |
Parameters for synchronizing a node pool template |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
lifecycle |
Yes |
NodeLifecycleConfig object |
Customized node lifecycle configurations |
login |
Yes |
Login object |
Node login mode. You can use both key pair and password login simultaneously.
NOTE:
This parameter cannot be modified when a node pool is being updated. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
preInstall |
No |
String |
Pre-installation scripts. The total number of characters after transcoding cannot exceed 10240.
NOTE:
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 scripts. The total number of characters after transcoding cannot exceed 10240.
NOTE:
The input value must be encoded using Base64. The method is as follows: echo -n "Content to be encoded" | base64 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
sshKey |
No |
String |
Name of the key pair used for login. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
username |
No |
String |
Login account. The default value is root. |
password |
Yes |
String |
Login password. If a username and password are used to create a node, this field is shielded in the response body. A password must meet the following complexity requirements:
|
Response Parameters
None
Example Requests
-
Synchronize 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 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.