This guide provides a comprehensive walkthrough for upgrading Rancher on your existing Kubernetes cluster. Upgrading Rancher is a critical step to ensure you benefit from the latest features, security updates, and bug fixes. By following this guide, you will safely upgrade Rancher to the desired version with minimal disruption to your current setup.
- Introduction
- Prerequisites
- Step 1 - Changing to the Correct Cluster Context
- Step 2 - Refreshing Your Helm Repository
- Step 3 - Identifying the Rancher Installation Repository
- Step 4 - Downloading the Latest Rancher Chart
- Step 5 - Saving Current Settings
- Step 6 - Viewing Available Charts and Versions
- Step 7 - Upgrading Rancher
- Conclusion
Before proceeding with the upgrade, ensure you have:
- Administrative access to the Kubernetes cluster where Rancher is installed.
- The
kubectl
tool configured to communicate with your cluster. - Back up the Rancher cluster. For details, you can follow Backing Up Rancher.
- Helm installed and configured on your machine.
Switch to the cluster context where Rancher is installed to apply the upgrade commands correctly.
kubectl config use-context [context-name]
Ensure your Helm repository is up-to-date to fetch the latest Rancher chart.
helm repo update
Add the Rancher stable repository if not already present. This repository contains the latest official releases of Rancher.
helm repo add rancher-stable https://releases.rancher.com/server-charts/stable
Fetch the latest Rancher chart from the Helm repository to your local machine.
helm fetch rancher-stable/rancher
Export the current Rancher settings to a YAML file. This step is crucial for retaining your configurations after the upgrade.
helm get values rancher -n cattle-system -o yaml > values.yaml
Check for available Rancher chart versions to determine which version you wish to upgrade to.
helm search repo rancher-stable/rancher --versions | sort -r | head -n 5
Upgrade Rancher to a version that suits your environment and needs. Ensure to replace {{desired_version}}
with the specific version number of Rancher you intend to upgrade to.
helm upgrade rancher rancher-stable/rancher \
--namespace cattle-system \
-f values.yaml \
--version={{desired_version}}
Following these steps will upgrade Rancher to the specified version on your Kubernetes cluster. After the upgrade, you will enjoy the latest features and improvements available in Rancher. It is advisable to check the Rancher documentation for any post-upgrade actions or changes.
Go back to Home.