Kubernetes, Konvoy

How to Perform a Basic Rolling Upgrade of a Kubernetes Cluster

Mar 30, 2021

Alex Hisaka

D2iQ

In today’s digital landscape, users expect applications to be available at all times and developers are expected to deploy new versions of these applications several times a day. Both of these expectations can be met by upgrading your Kubernetes cluster. Kubernetes is constantly getting new features and security updates, so your Kubernetes cluster needs to be kept up-to-date as well. Because there are several different ways to upgrade a Kubernetes cluster, your upgrade strategy may change depending on the type of cluster you’re trying to upgrade. 
 

D2iQ Konvoy removes these complexities by providing controls to upgrade Kubernetes in a variety of ways, from upgrading Kubernetes itself to Kubernetes add-ons, all in one place without disruption.

 

In this tutorial, we’ll walk through how to conduct a basic rolling upgrade of a Kubernetes cluster in less than five minutes, so you can perform ongoing updates much easier and in less time.

 

Step 1: Run the Get Nodes Command

Once you have your cluster up and running, check the version of all of your nodes by running the cube cuddle get nodes command. The get nodes command shows the version of all your nodes in your cluster are 1.16.4. 
 

Step 2: Configure D2iQ Konvoy for the Upgrade

Next, you’ll want to configure D2iQ Konvoy for the upgrade by upgrading the version of your Kubernetes in the cluster.yaml file. Find the section of the configuration that covers the version and update your cluster from 1.16.4 to 117.8. Once you’ve updated your cluster, go ahead and save this file.

 

Before upgrading, It’s important to read through your docs and follow best practices. For example, if you’re upgrading in production, make sure to back up your cluster. Also, depending on what version your cluster is, it may not be possible to upgrade directly to the latest version in one hop. 

 

Step 3: Upgrade Your Cluster with the Konvoy Up Command

The third step is to kick off the upgrade with the D2iQ Konvoy$ konvoy up ---upgrade command. You want to tell Konvoy to go ahead and continue with the upgrade, and this should take a few minutes to run. 
 

The upgrade starts by upgrading the control plane. In get nodes output at the bottom of your screen, you should notice the master nodes upgrade one at a time, followed by the worker nodes.
 

Each worker node is automatically drained during the process before the upgrade. It’s then returned to service. The upgrade will continue until all nodes have been completed.
 

Once the upgrade is completed, check to make sure the server version has been updated to 117.8. 
 

Now that you’ve completed a basic Kubernetes upgrade, you can keep your cluster updated with minimal disruptions to your workloads.
 

For more information on Kubernetes upgrades, check out our advanced Kubernetes upgrade tutorial, or sign up for one of our upcoming workshops.

Ready to get started?