Upgrade

Upgrade with KubeKey

KubeKey is recommended for users whose KubeSphere and Kubernetes were both deployed by KubeSphere Installer. If your Kubernetes cluster was provisioned by yourself or cloud providers, please refer to Upgrade with ks-installer.

Prerequisites

  • You need to have a KubeSphere cluster running version 2.1.1.

Warning

If your KubeSphere version is v2.1.0 or earlier, please upgrade to v2.1.1 first.
  • Download KubeKey.

Download KubeKey using the following command:

wget -c https://kubesphere.io/download/kubekey-v1.0.0-linux-amd64.tar.gz -O - | tar -xz

Download KubeKey from GitHub Release Page or use the following command directly.

wget https://github.com/kubesphere/kubekey/releases/download/v1.0.0/kubekey-v1.0.0-linux-amd64.tar.gz -O - | tar -xz

Make kk executable:

chmod +x kk

Warning

In v3.0.0, KubeSphere refactors many of its components such as Fluent Bit Operator and IAM. Make sure you back up any important components in case you heavily customized them but not from console.
  • Make your upgrade plan. Two upgrading scenarios are documented below.

Upgrade KubeSphere and Kubernetes

Upgrading steps are different for single-node clusters (all-in-one) and multi-node clusters.

Info

  • Upgrading with Kubernetes will cause helm to be upgraded from v2 to v3. If you want to continue using helm2, please back up it: cp /usr/local/bin/helm /usr/local/bin/helm2
  • When upgrading Kubernetes, KubeKey will upgrade from one MINOR version to the next MINOR version until the target version. For example, you may see the upgrading process going from 1.16 to 1.17 and to 1.18, instead of directly jumping to 1.18 from 1.16.

All-in-one Cluster

The following command upgrades your single-node cluster to KubeSphere v3.0.0 and Kubernetes v1.17.9 (default):

./kk upgrade --with-kubesphere --with-kubernetes

To upgrade Kubernetes to a specific version, please explicitly provide the version after the flag --with-kubernetes. Available versions are:

  • v1.15.12
  • v1.16.8, v1.16.10, v1.16.12, v1.16.13
  • v1.17.0, v1.17.4, v1.17.5, v1.17.6, v1.17.7, v1.17.8, v1.17.9
  • v1.18.3, v1.18.5, v1.18.6

Multi-node Cluster

Step1: Generate a configuration file with KubeKey

This command creates a configuration file config-sample.yaml from your cluster.

./kk create config --from-cluster

Note

It assumes your kubeconfig is allocated in ~/.kube/config. You can change it with the flag --kubeconfig.

Step 2: Modify the configuration file template

Modify config-sample.yaml to fit your cluster setup. Make sure you replace the following fields correctly.

  • hosts: Input connection information among your hosts.
  • roleGroups.etcd: Input etcd members.
  • controlPlaneEndpoint: Input your load balancer address (Optional).
  • registry: Input image registry information (Optional).

Note

Please refer to the Cluster section of config-example.yaml for more information.

Step 3: Upgrade your cluster

The following command upgrades your cluster to KubeSphere v3.0.0 and Kubernetes v1.17.9 (default):

./kk upgrade --with-kubesphere --with-kubernetes -f config-sample.yaml

To upgrade Kubernetes to a specific version, please explicitly provide the version after the flag --with-kubernetes. Available versions are:

  • v1.15.12
  • v1.16.8, v1.16.10, v1.16.12, v1.16.13
  • v1.17.0, v1.17.4, v1.17.5, v1.17.6, v1.17.7, v1.17.8, v1.17.9
  • v1.18.3, v1.18.5, v1.18.6