Skip to main content
Version: 21.11

Version upgrade

As part of Redpanda's evolution, new versions are released over time to deliver new features, enhancements, and improvements. Due to that, it's essential to keep Redpanda up to date. This guide details how to upgrade versions relevant to the environment that Redpanda is currently running in.

info

Please refer to the release notes before upgrading to alternate versions in order to anticipate and deal with any breaking changes.

Checking the current version

Before changing to a different version, you will first need to determine which version is currently running in your environment. In order to determine the current version, you will need to utilize the rpk command as shown below:

rpk version

The expected output will look similar to:

v21.11.5 (rev af88fa1)

Kubernetes

caution

In order to prevent any potential data loss when Kubernetes is locally executed, you will need to utilize persistent volumes.

All applications running in Kubernetes require deployment files to execute, including Redpanda. To upgrade to the latest version, change the version tag in your deployment file:

...
spec:
image: "vectorized/redpanda"
version: "<current_version>"
...

After saving the file, you will need to apply the changes with the following command:

kubectl apply -f <file_path/file_name>

Once the changes are applied, the cluster will perform a rolling upgrade, restarting one pod at a time. During the upgrade, the status field upgrading is true. You will be able to see the status of the cluster by running the following command:

kubectl describe cluster <cluster_name>

The upgrading status will show as false once the upgrade is complete.

To validate the individual pod details, and the image tag (version), use the following command:

kubectl describe pod <pod_name>

Docker

Because Docker relies on images, you will need to replace the current image value with a new one. First, check which image version is currently running on your Docker:

docker images

After running the command, you will see a list of images, including Redpanda. Now it's time to check the available versions on the release notes page. Before beginning the upgrade, you will need to backup Redpanda's configuration file in order to avoid configuration losses.

docker cp <containerId>:/etc/redpanda/redpanda.yaml <preferred location>

Also, you will need to verify that there is no Redpanda container up and running:

docker ps
caution

In order to prevent any potential data loss when Docker is locally executed, you will need to utilize persistent volumes. You will find the steps to do that here: persistent volumes.

Stop and remove Redpanda's container(s):

docker stop <container_id>
...
docker rm <container_id>

Remove current images:

docker rmi <image_id>

The next step is to pull the desired Redpanda's version, or you can adjust the setting to latest in the version tag:

docker pull docker.redpanda.com/vectorized/redpanda:<version>

Finally, you'll need to follow the steps in the docker getting started to start Redpanda. If you are using a previous redpanda.yaml configuration file, make sure to apply it to the configuration folder /etc/redpanda inside the container.

docker cp <path_to_saved_yaml_file>/redpanda.yaml <container_id>:/etc/redpanda

Once completed, restart the cluster:

docker restart <container_name>

Now, you will have the desired version of Redpanda running.

Linux

For Linux distributions, the process is simple; however, it changes according to the distribution:

Execute the following commands on the terminal:

sudo yum update redpanda

Once the upgrade is complete, you can perform the following check to validate the action:

rpk version

MacOS

If you have previously installed Redpanda with brew, you can run the following command:

brew install vectorizedio/tap/redpanda

Installations from binary files require you to download the preferred version from the release list and then to overwrite the current rpk file in the installed location.

Windows

Currently, it's only possible to run Redpanda on Docker. Therefore, the Docker guide would be applicable here.

Post-upgrade applications

Once the upgrade is complete, you will need to ensure that the cluster is healthy. To verify that the cluster is running properly, implement the following command:

rpk cluster status

You'll also want to set up a real-time dashboard to monitor your cluster health. That can be done by following the steps in our monitoring guide.