This topic describes how to upgrade the Kubernetes version of your edge cluster in the Container Service console. The cluster upgrade process involves three phases: precheck, master node upgrade, and node upgrade. For dedicated clusters, the serial number of the master node that is being upgrade, which starts from 1, will be provided during master node upgrade. During node upgrade, the numbers of upgraded nodes and total nodes are provided.
How the upgrade works
- Upgrade policy
The upgrade policy defines how the upgrade is implemented. Currently, the default policy is batch upgrade. The batch upgrade policy is used during node upgrade to upgrade nodes in the cluster in batches. The policy works as follows:
- The first batch includes one node and the number of nodes increases by the power of 2 in batches thereafter. If you pause the upgrade and resume it later, the first batch after the pause includes one node and the number of nodes increases by the power of 2 in batches thereafter.
- The maximum number of nodes in each batch does not exceed 10% of the total number of nodes.
When you start the upgrade process, a precheck is run automatically to detect possible upgrade issues. The system performs health checks on multiple aspects of the cluster to guarantee that the upgrade can be completed smoothly.If your cluster contains configuration errors or potential risks, the precheck may fail, as shown in the following figure.Click View Details. The details page appears, which displays the cause of the failure.
- Pause the upgrade
You can pause the upgrade process at any time during the upgrade.Note
- After being paused, the upgrade will be completed on nodes that have started the upgrade. The upgrade will not be performed on nodes that have not started the upgrade.
- We recommend that you do not perform operations on the cluster when the upgrade is paused and resume the upgrade as soon as possible.
After the upgrade is paused, click Continue to resume the upgrade process.
If an error occurs during the upgrade, the system pauses the upgrade process. The cause of the error will appear at the bottom of the page.
- Cancel the upgrade
After the upgrade is paused, you can click Cancel to cancel the upgrade.Note
- After being canceled, the upgrade will be completed on nodes that have started the upgrade. The upgrade will not be performed on nodes that have not started the upgrade.
- Nodes that have completed the upgrade are not affected.
- To upgrade a cluster, nodes in the cluster must have Internet access to download upgrade packages.
- During the upgrade process of your Kubernetes edge cluster, the applications running in the cluster are not interrupted. Applications highly dependent on the API server may be interrupted temporarily.
- If you have made configuration changes to the cluster, for example, creating SWAP partitions, errors may occur during the upgrade process.
- You can pause the upgrade after a batch of nodes has completed the upgrade. We recommend that you do not perform operations on the cluster when the upgrade is paused and resume the upgrade as soon as possible. If the upgrade has been paused for more than 15 days, it will end automatically, deleting related events and log information.
- During the upgrade process, do not modify the resources under the kube-upgrade namespace unless an error has occurred.
- If an error occurs during the upgrade, the upgrade will be paused. You need to troubleshoot the error and delete the failed pods under the kube-upgrade namespace. You can restart the upgrade after the error is resolved. If you need help, contact Alibaba Cloud technical support team.
Before upgrading a cluster, check the health status of the cluster to make sure that the cluster meets the upgrade requirements.
- Log on to the Container Service console.
- Preupgrades the nodes in the cluster.
- In the left-side navigation pane, choose Clusters page, click the name of the target cluster. The Basic Information page appears.. On the
- Click the KubeConfig (Public Access) tab. Copy the content of the kubeconfig file of the cluster to the $HOME/.kube/config file on the local computer.
- Run the following command on the local computer:
docker run -it -v ~/.kube:/root/.kube registry.cn-hangzhou.aliyuncs.com/edge-kubernetes/node-preprocess:v0.1.0 Nodes on the cloudNote You must specify nodes on the cloud in this command. This parameter is not required if your cluster contains no node on the cloud.
- In the left-side navigation pane, choose . The Clusters page appears.
- Find the target cluster and choose Actions column. in the
- On the Cluster Service page that appears, choose in the left-side navigation pane.
- On the Upgrade Check page that appears, click Execute Inspect.
- In the Upgrade Check dialog box that appears, select the check box under Warning and click Start.
After the upgrade check is complete, click View Details.When Check Resource Result in the report is Normal, the cluster passes the check and you can perform upgrade operations.
If abnormal nodes are found in the cluster, you must fix the issue before you can upgrade the cluster. Submit a ticket if you need help.
- Log on to the Container Service console.
- In the left-side navigation pane, choose Upgrade Cluster in the Actions column. The Kubernetes cluster upgrade page appears.
. On the Clusters page that appears, find the target cluster and click
- Click Upgrade.
- In the dialog box that appears, click Confirm.
You can now view the progress of the upgrade.