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

How an ACK cluster is updated

The following section describes how an ACK cluster is updated and the steps that are involved in the update process. How an ACK cluster is updated

Update policy

The update policy defines how the ACK cluster is updated. The default policy is batch update. Batch update is performed during the worker node update phase to update worker nodes in batches. The policy works in the following manner:
  • Multiple node pools are updated one after one.
  • The nodes in a node pool are updated in batches. The first batch includes one node. The number of nodes increases based on the powers of two in subsequent batches. The batch update policy still applies after you resume a paused update process.
  • The system updates no more than 10 nodes in each batch.

Precheck

After you start the update process, a precheck is automatically performed to detect potential update issues. The precheck includes multiple check items to ensure that the cluster can be successfully updated.

If your cluster contains configuration errors or potential risks, the cluster fails to pass 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 your cluster fails to pass the precheck, you can manually resolve the issues or Submit a ticket.
  • Prechecks are performed only before clusters are updated. A cluster can still run as normal and the cluster status does not change if the cluster fails to pass a precheck.
  • After a cluster passes the precheck, the system starts to update the cluster.

Pause the update

You can pause the update process anytime when the update is in progress.
Note
  • This operation does not pause the update for nodes that are being updated. The system pauses the update only for nodes in the update queue.
  • Do not perform operations after you pause the update for a cluster. We recommend that you resume and complete the update at your earliest convenience.

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

If an error occurs during the update, the system automatically pauses the update process. The cause of the error appears in the lower part of the page. You can troubleshoot the error based on the provided information or Submit a ticket.

Cancel the update

After you pause the update, you can click Cancel to cancel the update.
Note
  • This operation does not cancel the update for nodes that are being updated. The system pauses the update only for nodes in the update queue.
  • You cannot cancel the update after the nodes are updated.

Considerations

  • To update a cluster, nodes in the cluster must have Internet access to download the update packages.
  • The update may fail. To ensure data security, we recommend that you create snapshots before you start the update. 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 update. 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 update. You must recreate the pods that use OSS volumes after the update is completed.
  • You can modify the configurations of the cluster during the update process. For example, you can create SWAP partitions. In this case, the update may fail.
  • You can pause the update after multiple nodes are updated. We recommend that you do not modify the cluster settings when the update is paused. We recommend that you resume the update at the earliest opportunity. If the update is paused for more than 15 days, the system automatically terminates the update process. The events and log data that are generated during the update process are also deleted.
  • Do not modify the resources in the kube-upgrade namespace during the update process unless an error occurs.
  • If an error occurs during the update process, the update is paused. You must troubleshoot the error and delete the failed pods in the kube-upgrade namespace. You can restart the update after the error is fixed. You can contact the Alibaba Cloud technical support team for assistance.
  • After the update is completed, we recommend that you update kubectl on your on-premises machine. Otherwise, the kubectl version may be incompatible with the API server version. As a result, the error message invalid object doesn't have additional properties may appear.
  • You can update 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 update the Kubernetes version to 1.18, you must manually update 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 update the image version of alicloud-nas-controller to v1.14.8.17-7b898e5-aliyun or later before you can update an earlier Kubernetes version to 1.20.

Step 1: Perform a precheck

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

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

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

    If the result is normal in the report, the cluster passes the precheck and you can update the cluster.

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

Step 2: Update the cluster

  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 update.
    Note
    • If you want to pause the update, click Pause.
    • After the update is paused, you can click Cancel to cancel the update.

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