Upgrading a Cluster
Function
Cluster upgrade
-
Cluster upgrade involves many operations on components. You are advised to upgrade your cluster on the CCE console, a more interactive and intuitive way to reduce operational risks.
-
Currently, cluster upgrade APIs are available only upon request.
URI
POST /api/v3/projects/{project_id}/clusters/{cluster_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. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| metadata | Yes | Upgrade metadata. | |
| spec | Yes | UpgradeSpec object | Upgrade settings. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| apiVersion | Yes | String | API version. Defaults to v3. |
| kind | Yes | String | Resource type. Defaults to UpgradeTask. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| clusterUpgradeAction | No | ClusterUpgradeAction object | Cluster upgrade settings. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| addons | No | Array of UpgradeAddonConfig objects | Add-on configuration list. |
| nodeOrder | No | Map<String,Array<NodePriority>> | Upgrade sequence of nodes in the node pool. NOTE: key indicates the node pool ID. Defaults to DefaultPool. |
| nodePoolOrder | No | Map<String,Integer> | Upgrade sequence of a node pool, in key-value pairs. NOTE: key indicates the node pool ID. Defaults to DefaultPool. value means the priority of a node pool. Defaults to 0, indicating the lowest priority. A larger value indicates a higher priority. |
| strategy | Yes | UpgradeStrategy object | Upgrade policy. |
| targetVersion | Yes | String | Target cluster version, for example, v1.23. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| addonTemplateName | Yes | String | Add-on name. |
| operation | Yes | String | Execution action. For current upgrades, the value can be patch. |
| version | Yes | String | Target add-on version. NOTE: The target add-on version must match the target cluster version. For details about the mapping between the add-on versions and CCE standard and Turbo cluster versions, see Listing Add-on Templates. |
| values | No | Object | Add-on parameter list, in key-value pairs. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| nodeSelector | Yes | NodeSelector object | Node label selector, which selects a batch of nodes. |
| priority | Yes | Integer | Priority of this batch of nodes. Defaults to 0, indicating the lowest priority. A larger value indicates a higher priority. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| key | Yes | String | Label key. |
| value | No | Array of strings | Label value list. |
| operator | Yes | String | Logical operators of labels. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| type | Yes | String | Upgrade policy type. Supports only inPlaceRollingUpdate. |
| inPlaceRollingUpdate | No | InPlaceRollingUpdate object | In-place upgrade settings. Mandatory when the in-place upgrade policy type is specified. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| metadata | Upgrade task metadata | |
| spec | UpgradeResponseSpec object | Upgrade settings |
| Parameter | Type | Description |
|---|---|---|
| uid | String | Upgrade task ID. You can obtain the progress by calling the API for obtaining cluster upgrade task details. |
| Parameter | Type | Description |
|---|---|---|
| clusterUpgradeAction | ClusterUpgradeResponseAction object | Cluster upgrade settings |
| Parameter | Type | Description |
|---|---|---|
| version | String | Current cluster version |
| targetVersion | String | Target cluster version, for example, v1.23. |
| targetPlatformVersion | String | Platform version of the target cluster, which is an internal version of the cluster version and cannot be specified. |
| strategy | UpgradeStrategy object | Upgrade policies |
| config | Object | Cluster configuration specified during an upgrade |
| Parameter | Type | Description |
|---|---|---|
| type | String | Upgrade policy type. Supports only inPlaceRollingUpdate. |
| inPlaceRollingUpdate | InPlaceRollingUpdate object | In-place upgrade settings. Mandatory when the in-place upgrade policy type is specified. |
Example Requests
Upgrade the cluster to v1.23 and set the node upgrade step to 20.
POST /api/v3/projects/{project_id}/clusters/{cluster_id}/operation/upgrade
{
"metadata" : {
"apiVersion" : "v3",
"kind" : "UpgradeTask"
},
"spec" : {
"clusterUpgradeAction" : {
"strategy" : {
"type" : "inPlaceRollingUpdate",
"inPlaceRollingUpdate" : {
"userDefinedStep" : 20
}
},
"targetVersion" : "v1.23"
}
}
} Example Responses
Status code: 200
Cluster upgrade requested.
{
"metadata" : {
"uid" : "976a33e2-f545-11ed-87af-0255ac1002c2"
},
"spec" : {
"clusterUpgradeAction" : {
"version" : "v1.19.16-r20",
"targetVersion" : "v1.23.8-r0",
"targetPlatformVersion" : "cce.10",
"strategy" : {
"type" : "inPlaceRollingUpdate",
"inPlaceRollingUpdate" : {
"userDefinedStep" : 20
}
},
"config" : { }
}
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Cluster upgrade requested. |
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.