This topic describes how to upgrade the Kubernetes version of a Container Service for Kubernetes (ACK) cluster in the ACK console. You can go to the Clusters page to check the Kubernetes version of your cluster and check whether the current version can be upgraded. The cluster upgrade process consists of the following phases: precheck, master node upgrade, and worker node upgrade. For a dedicated Kubernetes cluster, when the system upgrades master nodes, the page displays the sequence number of the master node that is being upgraded. When the system upgrades worker nodes, the page displays the number of upgraded worker nodes and the total number of worker nodes.

How an ACK cluster is upgraded

The following section describes how an ACK cluster is upgraded and steps that are involved in the upgrade process. Upgrade flowchart
  • Upgrade policy
    The upgrade policy defines how the ACK cluster is upgraded. The default policy is batch upgrade. Batch upgrade is performed during the worker node upgrade phase to upgrade worker nodes in batches. The policy works in the following manner:
    • The first batch includes one node. The number of nodes increases by the power of 2 in subsequent batches. If you resume a paused upgrade, the first batch after the resume includes one node. The number of nodes increases by the power of 2 in subsequent batches.
    • 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 automatically performed to detect potential upgrade issues. The precheck includes multiple check items to ensure that the cluster can be successfully upgraded.

    If your cluster contains configuration errors or potential risks, the cluster fails the precheck, as shown in the following figure.
    Click View Details. You are redirected to the details page on which you can check the cause of the failure. Failed precheck
    Note
    • If the cluster fails the precheck, you must resolve the issues. You can also Submit a ticket to request technical support.
    • Prechecks are performed only before clusters are upgraded. A cluster can still run as before and its status is not changed if it fails to pass a precheck.
    • After a cluster passes the precheck, the system starts to upgrade the cluster.
  • Pause the upgrade
    You can pause the upgrade process anytime when the upgrade is in progress.
    Note
    • This operation does not pause the upgrade for nodes that are being upgraded. It pauses the upgrade only for nodes in the upgrade queue.
    • Do not perform operations after you pause the upgrade of a cluster. In addition, we recommend that you resume and complete the upgrade at your earliest convenience.

    After you pause the upgrade, you can click Continue to resume the upgrade process.

    If an error occurs during the upgrade, the system automatically pauses the upgrade process. The cause of the error appears in the lower part of the page. You can troubleshoot the error or Submit a ticket to request technical support.

  • Cancel the upgrade
    After you pause the upgrade, you can click Cancel to cancel the upgrade.
    Note
    • This operation does not cancel the upgrade for nodes that are being upgraded. It cancels the upgrade only for nodes that are in the upgrade queue.
    • In addition, you cannot cancel the upgrade after the nodes are upgraded.

Considerations

  • To upgrade a cluster, nodes in the cluster must have Internet access to download upgrade packages.
  • The upgrade may fail. To ensure data security, we recommend that you create snapshots before you start the upgrade. For more information about how to create a snapshot of an Elastic Compute Service (ECS) instance, see Create a snapshot for a disk.
  • Applications that run in the cluster are not interrupted during the upgrade. Applications that are strongly reliant on the API server may be temporarily interrupted.
  • Object Storage Service (OSS) volumes that are mounted to the Kubernetes cluster by using FlexVolume 1.11.2.5 or earlier will be remounted during the upgrade. You must recreate the pods that use OSS volumes after the upgrade is completed.
  • You can modify the configurations of the cluster during the upgrade process. For example, you can create SWAP partitions. In this case, the upgrade may fail.
  • You can pause the upgrade after multiple nodes are upgraded. We recommend that you do not modify the cluster settings when the upgrade is paused. We recommend that you resume the upgrade at the earliest opportunity. If the upgrade is paused for more than 15 days, the system automatically terminates the upgrade process. The events and log data that are generated during the upgrade process are also deleted.
  • Do not modify the resources in the kube-upgrade namespace during the upgrade process unless an error occurs.
  • If an error occurs during the upgrade process, the upgrade is paused. You must troubleshoot the error and delete the failed pods in the kube-upgrade namespace. You can restart the upgrade after the error is fixed. You can contact the Alibaba Cloud technical support team for assistance.
  • After the upgrade is completed, we recommend that you upgrade kubectl on your on-premises machine. Otherwise, the kubectl version may not be compatible with the API server version. As a result, the error message invalid object doesn't have additional properties may appear.
  • You can upgrade the Kubernetes version of an ACK cluster only to the later version. For example, the Kubernetes version of an ACK cluster is 1.12. If you want to upgrade the Kubernetes version to 1.18, you must manually upgrade the version to 1.14, 1.16, and then 1.18 in sequence.
  • ACK clusters that run Kubernetes 1.20 do not support the selfLink field. If FlexVolume is used and alicloud-nas-controller is installed in your cluster, you must upgrade the image version of alicloud-nas-controller to v1.14.8.17-7b898e5-aliyun or later before you can upgrade an earlier Kubernetes version to 1.20.

Preparations

Note If the cluster that you want to upgrade is not deployed in the production environment, we recommend that you check whether the cluster meets the upgrade requirements before you start the upgrade in the production environment.

Before you upgrade a cluster, you must check the health status of the cluster and make sure that the cluster meets the upgrade requirements.

  1. Log on to the ACK console.
  2. In the left-side navigation pane of the ACK console, click Clusters.
  3. On the Clusters page, find the cluster on which you want to perform a check and choose More > Cluster Check in the Actions column.
  4. In the left-side navigation pane of the Container Service Operation Center page, choose Cluster Check > Upgrade Check.
  5. On the Upgrade Check page, click Start.
  6. In the Upgrade Check panel, select the check box under Warning and click Start.
    After the upgrade precheck is completed, click Details.

    If the result is normal in the report, the cluster passes the precheck and you can perform upgrade operations.

If issues are found in the cluster, you must resolve the issues before you can upgrade the cluster. If you require technical support, Submit a ticket.

Procedure

  1. Log on to the ACK console.
  2. In the left-side navigation pane of the ACK console, click Clusters.
  3. On the Clusters page, find the cluster that you want to upgrade and choose More > Upgrade Cluster in the Actions column.
  4. Click Upgrade.
  5. In the message that appears, click Confirm.
    You can view the progress of the upgrade.
    Note
    • If you want to pause the upgrade, click Pause.
    • After the upgrade is paused, you can click Cancel to cancel the upgrade.

After the upgrade is completed, you can go to the Clusters page and check the Kubernetes version of your cluster.