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.

Before upgrading to alternate versions, refer to the release notes to learn about 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. To determine the current version, run the following commands:

  • Linux

  • MacOS

  • Kubernetes

  • Docker

curl -s -XGET http://<broker host>:9644/v1/brokers/
The command returns all broker information at once. Remember to replace the variable <broker host>.
brew list --versions | grep redpanda
kubectl exec -it -n <cluster_name> <pod-name> -- rpk version
Remember to replace the variables <cluster_name> and <pod_name>.
Running Redpanda directly via Docker is not supported for production usage. This platform should only be used for testing.
docker exec -it <container_name> rpk version
Remember to replace the variable <container_name>.

The expected output looks similar to:

v21.11.5 (rev af88fa1)

Available versions

You can check which versions are available in the release notes.

Upgrading your version

When upgrading between major versions, Redpanda only supports upgrading one version at a time. For example, upgrading from 22.1 to 22.2 is supported, while upgrading from 22.1 directly to 22.3 is not. In the latter case, you would upgrade first to 22.2, and then to 22.3.
  • Linux

  • MacOS

  • Kubernetes

  • Docker

For Linux distributions, the process changes according to the distribution:

  • Fedora/RedHat

  • Debian/Ubuntu

Execute the following commands on the terminal:

sudo yum update redpanda

Execute the following commands on the terminal:

sudo apt update
sudo apt install redpanda

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.

To prevent any potential data loss when Kubernetes is locally executed, you must use 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>
Running Redpanda directly via Docker is not supported for production usage. This platform should only be used for testing.

To perform an upgrade you must replace the current image with a new one. First, check which image is currently running on your Docker:

docker ps
To prevent any potential data loss when Docker is locally executed, you must use persistent volumes. For more information, refer to persistent volumes.

Stop and remove Redpanda’s container(s):

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

Remove current images:

docker rmi <image_id>

Pull the desired Redpanda’s version, or adjust the setting to latest in the version tag:

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

If you have any questions about how to start Redpanda on Docker, refer to docker getting started.

Once completed, restart the cluster:

docker restart <container_name>

Post-upgrade applications

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

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

rpk cluster health

If you want to view additional information about your brokers, run:

rpk redpanda admin brokers list

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.

If you would like to perform a rolling upgrade on your cluster using maintenance mode, refer to Node Maintenance Mode. Keep in mind that rolling upgrades are only available in versions 22.1 and later.