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.

Prerequisites

Background information

You can go to the Clusters page to check the Kubernetes version of your edge cluster and see whether a new version is available for upgrade.Upgrade an edge cluster

How the upgrade works

The following figure shows how the upgrade works and the steps that are involved in the upgrade process.Upgrade diagram
  • 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.
  • Precheck

    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.Pre-check
    Click View Details. The details page appears, which displays the cause of the failure.Precheck failed
  • 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.

Precautions

  • 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.

Preparations

Note If your cluster to be upgraded is not in the production environment, we strongly recommend that you verify that the cluster meets upgrade requirements before upgrading the cluster in the production environment.

Before upgrading a cluster, check the health status of the cluster to make sure that the cluster meets the upgrade requirements.

  1. Log on to the Container Service console.
  2. Preupgrades the nodes in the cluster.
    1. In the left-side navigation pane, choose Cluster > Cluster. On the Clusters page, click the name of the target cluster. The Basic Information page appears.
    2. 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.
      kubeconfig
    3. 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 cloud
      Note You must specify nodes on the cloud in this command. This parameter is not required if your cluster contains no node on the cloud.
  3. In the left-side navigation pane, choose Cluster > Cluster. The Clusters page appears.
  4. Find the target cluster and choose More > Cluster Check in the Actions column.
  5. On the Cluster Service page that appears, choose Cluster Check > Upgrade Check in the left-side navigation pane.
  6. On the Upgrade Check page that appears, click Execute Inspect.
  7. In the Upgrade Check dialog box that appears, select the check box under Warning and click Start.
    Upgrade a cluster
    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.

Procedure

  1. Log on to the Container Service console.
  2. In the left-side navigation pane, choose Cluster > Cluster. On the Clusters page that appears, find the target cluster and click Upgrade Cluster in the Actions column. The Kubernetes cluster upgrade page appears.
    Clusters page
  3. Click Upgrade.
    Upgrade page
  4. In the dialog box that appears, click Confirm.
    You can now view the progress of the upgrade.
After the upgrade is completed, you can go to the Clusters page and check the current Kubernetes version of your edge cluster.
Upgrade completed