Help Center > > User Guide> Cluster Management> Upgrading a Cluster> Upgrading a Cluster

Upgrading a Cluster

Updated at: Feb 25, 2020 GMT+08:00

You can use the CCE console to upgrade your cluster to the latest Kubernetes version or a bug fix.

Precautions

  • To avoid data loss, back up data before the upgrade. If the upgrade fails, perform upgrade repair or upgrade rollback to protect data security. If the problem of data loss persists, create a service ticket.
  • The upgrade from 1.11 or earlier to 1.13 is not supported for clusters.
  • During the upgrade from v1.7 to v1.9, all pods in the cluster will be restarted and this will affect applications. Other upgrade paths will not interrupt applications in the cluster. However, if the applications rely heavily on the API Server, the upgrade may interrupt the applications for a short time.
  • During the upgrade from Kubernetes 1.9 to 1.11, the kube-dns of the cluster will be uninstalled and replaced with CoreDNS, which may cause loss of the cascading DNS configuration in the kube-dns or temporary interruption of the DNS service. Back up the DNS address configured in the kube-dns so you can configure the domain name in the CoreDNS again when domain name resolution is abnormal.

Preparation

Before upgrading a cluster, make sure that the cluster is healthy.

  1. Log in to the master node of the cluster. For details, see Connecting to a CCE Cluster Using kubectl or web-terminal.
  2. Run the following command to verify that all modules are in the Healthy state:

    kubectl get cs

    Information similar to the following is displayed:
    NAME                 STATUS    MESSAGE              ERROR
     scheduler            Healthy   ok
     controller-manager   Healthy   ok
     etcd-0               Healthy   {"health": "true"}
     etcd-1               Healthy   {"health": "true"}
     etcd-2               Healthy   {"health": "true"}

  3. Run the following command to verify that all nodes are in the Ready state:

    kubectl get nodes

    All nodes must be in the Ready state.

     NAME                   STATUS    ROLES     AGE       VERSION
     cn-north-1a-xxx   Ready     master    38d       v1.9.7-r1
     cn-north-1a-xxx   Ready     <none>    38d       v1.9.7-r1
     cn-north-1a-xxx   Ready     <none>    38d       v1.9.7-r1
     cn-north-1a-xxx   Ready     <none>    38d       v1.9.7-r1
     cn-north-1a-xxx   Ready     master    38d       v1.9.7-r1
     cn-north-1a-xxx   Ready     master    38d       v1.9.7-r1

Cluster Pre-upgrade Checklist

Before upgrading a cluster, follow the pre-upgrade checklist to identify risks and problems in advance.

Table 1 Cluster pre-upgrade checklist

Object

Check Item

Cluster

Check whether IP addresses (including EIPs) of cluster nodes are included in other configurations/whitelists.

Complete the pre-upgrade check.

Workload

Record the quantity and status of workloads for comparison after the upgrade.

Evaluate the possible changes that the upgrade may bring to whitelists, routing, and security group policies of databases (such as Redis and MongoDB).

Storage

Record storage status. Storage must not be lost after the upgrade.

Network

Check and back up load balancing services and Ingresses.

If Direct Connect is used and node/pod IP addresses may change after the upgrade, configure new routes on Direct Connect in advance.

Add-on

When Kubernetes v1.9 is upgraded to v1.11, the kube-dns of the cluster will be uninstalled and replaced with CoreDNS. Back up the DNS address configured in kube-dns so that you can configure the DNS address in CoreDNS when domain name resolution is abnormal.

O&M

Ensure that nodes and containers do not store configurations such as data-plane passwords, certificates, and environment variables. After the upgrade, nodes and containers may restart (typically, a container restarts when the pod is migrated from a faulty node to an available node) and the configurations will become lost, which results in service exceptions.

Check and back up kernel parameters or system configurations.

Procedure

This section describes how to upgrade a hybrid cluster from v1.9.10-r2 to v1.11.7-r0. The procedure for other upgrade paths is similar.

  1. Log in to the CCE console. In the navigation pane, choose Resource Management > Clusters. On the cluster list, view the cluster version. In this example, the cluster version is v1.9.10-r2.

    If your cluster version is up-to-date, the Upgrade button is unavailable.

  2. Click More for the cluster you want to upgrade, and select Upgrade from the drop-down menu.
  3. In the displayed Pre-upgrade Check dialog box, click Check Now.
  4. The pre-upgrade check starts. While the pre-upgrade check is in progress, the cluster status will change to Upgrading and new nodes/applications will not be able to be deployed on the cluster. However, existing nodes and applications will not be affected. It takes 3 to 5 minutes to complete the pre-upgrade check.
  5. When the status of the pre-upgrade check is Completed, click Upgrade.
  6. On the Upgrade Cluster page, confirm the basic information and click Next.
  7. On the Upgrade Add-on page, click Upgrade in the lower right corner.
  8. In the displayed Upgrade dialog box, confirm the information and click OK. The upgrade cannot be rolled back.
  9. You can return to the cluster list or cluster details page where you can view the cluster upgrade status.

    It takes some time to complete the upgrade. After the upgrade is complete, you can view the cluster version on the cluster list page.

  10. On the cluster list page, you can see that the cluster status is Upgrading. Please wait until the upgrade is completed.
  11. After the upgrade is complete, you can view the cluster version on the cluster list page.

    Figure 1 Verifying the upgrade success

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel