content/operate/kubernetes/7.22/upgrade/upgrade-olm.md
Redis implements rolling updates for software upgrades in Kubernetes deployments. The upgrade process includes updating three components:
The following steps ensure you have the minimum versions of all components necessary to upgrade. Without these minimum versions, the upgrade will freeze and require manual recovery.
See the troubleshooting section for details on recovering a failed upgrade.
Check [Supported Kubernetes distributions]({{<relref "/operate/kubernetes/7.22/reference/supported_k8s_distributions" >}}) to make sure your Kubernetes distribution is supported. If not, upgrade your Kubernetes distribution before upgrading the Redis operator.
Your Redis Enterprise clusters must be running version 7.4.2-2 or later before upgrading to 7.8.2-6. See the 7.4 upgrade for detailed steps.
Your Redis databases must be running version 7.2 or later before upgrading your cluster version to 7.8.2-6. See upgrade databases for detailed steps. You can find your database version in the [REDB spec.redisVersion field]({{<relref "/operate/kubernetes/7.22/reference/api/redis_enterprise_database_api#redisversion" >}}).
Upgrading to Redis operator version 7.8.2-6 or later involves migrating your Redis Enterprise nodes to RHEL9 from either Ubuntu 18 or RHEL8. If your databases use modules, you need to manually install modules compatible with RHEL9.
To see which modules you have installed, run:
curl -k -u <rec_username>:<rec_password> -X GET https://localhost:9443/v1/modules | jq -r 'map([.module_name, .semantic_version, (.platforms | keys)]) | .[] | .[0] as $name | .[1] as $version | .[2][] | $name + "-" + $version + "-" + .' | sort
To see which modules are currently in use, run:
curl -k -u <rec_username>:<rec_password> -X GET https://localhost:9443/v1/bdbs | jq -r '.[].module_list | map(.module_name + "-" + .semantic_version) | .[]'
See [Upgrade modules]({{<relref "/operate/oss_and_stack/stack-with-enterprise/install/upgrade-module">}}) for details on how to upgrade modules with the rladmin tool.
Use kubectl get rec and verify the LICENSE STATE is valid on your REC before you start the upgrade process.
Select the Redis Enterprise Operator from the Operators>Installed Operators page.
Select the Subscription tab.
Verify your Update approval is set to "Manual".
To upgrade to the latest version, set your Update Channel to ‘production’. To upgrade to an older version, specify the desired version for your Update Channel.
Select Upgrade available shown under Upgrade status.
When the "Review manual InstallPlan" section appears, select Preview installPlan and then Approve after reviewing the details. This will start the operator upgrade.
You can monitor the upgrade from the Installed Operators page. A new Redis Enterprise Operator will appear in the list, with the status "Installing". OpenShift will delete the old operator, showing the "Cannot update" status during deletion.
Upgrades to versions 7.22.0-6 and later run in unprivileged mode without any additional permissions or capabilities. If you don't specifally require additional capabilities, we recommend you maintain the default unprivileged mode, as its more secure. After upgrading, remove the existing redis-enterprise-scc-v2 SCC and unbind it from the REC service account.
To enable automatic resource adjustment, see [Allow automatic resource adjustment > OpenShift upgrades]({{< relref "/operate/kubernetes/7.22/security/allow-resource-adjustment#openshift-upgrades" >}}).
{{<warning>}} Verify your license is valid before upgrading. Invalid licenses will cause the upgrade to fail.
Use oc get rec and verify the LICENSE STATE is valid on your REC before you start the upgrade process.
{{</warning>}}
The Redis Enterprise cluster (REC) can be updated automatically or manually. To trigger automatic upgrade of the REC after the operator upgrade completes, specify autoUpgradeRedisEnterprise: true in your REC spec. If you don't have automatic upgrade enabled, follow the below steps for the manual upgrade.
Before beginning the upgrade of the Redis Enterprise cluster, check the K8s operator [release notes]({{<relref "/operate/kubernetes/release-notes">}}) to find the Redis Enterprise image tag.
After the operator upgrade is complete, you can upgrade Redis Enterprise cluster (REC).
redisEnterpriseImageSpecEdit the REC custom resource YAML file.
oc edit rec <your-rec.yaml>
Replace the versionTag: declaration under redisEnterpriseImageSpec with the new version tag.
spec:
redisEnterpriseImageSpec:
imagePullPolicy: IfNotPresent
repository: redislabs/redis
versionTag: <new-version-tag>
Save the changes to apply.
If your operator is monitoring multiple namespaces, you'll need to [reapply your role and role bindings]({{< relref "/operate/kubernetes/7.22/re-clusters/multi-namespace#create-role-and-role-binding-for-managed-namespaces" >}}) for each managed namespace. See [Manage databases in multiple namespaces]({{< relref "/operate/kubernetes/7.22/re-clusters/multi-namespace" >}}) for more details.
You can view the state of the REC with oc get rec.
During the upgrade, the state should be Upgrade.
When the upgrade is complete and the cluster is ready to use, the state will change to Running.
If the state is InvalidUpgrade, there is an error (usually relating to configuration) in the upgrade.
$ oc get rec
NAME NODES VERSION STATE SPEC STATUS LICENSE STATE SHARDS LIMIT LICENSE EXPIRATION DATE AGE
rec 3 6.2.10-107 Upgrade Valid Valid 4 2022-07-16T13:59:00Z 92m
To see the status of the current rolling upgrade, run:
oc rollout status sts <REC_name>
After the cluster is upgraded, you can upgrade your databases. To upgrade your REDB, specify your new database version in the spec.redisVersion field in the REDB custom resources. Supported database versions for operator versions include "7.2" and "7.4" (note this value is a string).
To upgrade your REAADB, see [Upgrade an Active-Active database]({{<relref "/operate/rs/installing-upgrading/upgrading/upgrade-active-active/">}}) for details on the rladmin and crdb-cli commands required. Reach out to Redis support if you have additional questions.
Note that if your cluster [redisUpgradePolicy]({{<relref "/operate/kubernetes/7.22/reference/api/redis_enterprise_cluster_api#redisupgradepolicy" >}}) or your database [redisVersion]({{< relref "/operate/kubernetes/7.22/reference/api/redis_enterprise_database_api#redisversion" >}}) are set to major, you won't be able to upgrade those databases to minor versions. See [Redis upgrade policy]({{< relref "/operate/rs/installing-upgrading/upgrading#redis-upgrade-policy" >}}) for more details.
The Redis Enterprise cluster (REC) can be updated automatically or manually. To trigger automatic upgrade of the REC after the operator upgrade completes, specify autoUpgradeRedisEnterprise: true in your REC spec. If you don't have automatic upgrade enabled, follow the below steps for the manual upgrade.
If you start an upgrade without meeting the prerequisites, the operator will freeze the upgrade. Check the operator logs for the source of the error. The REDB reconsilliation doesn't work during an upgrade, so you need to apply a manual fix with the Redis Software API (examples below). The updates will also need to be added to the REDB custom resource.
If the operator logs show an event related to an unsupported module, download the updated module locally, and install it using the v2/modules API endpoint.
curl -sfk -u <rec_username>:<rec_password> -X POST -F 'module=@<full path to your module>' https://localhost:9443/v2/modules
After updating the modules with the Redis Software API, update the REDB custom resource to reflect the change.
If the operator logs show an event related to an incompatible database version, upgrade the database using the Redis Software API.
curl -sfk -u <rec_username>:<rec_password> -X POST -H "Content-Type: application/json" -d '{"redis_version": <target redis version>}' https://localhost:9443/v1/bdbs/<BDB UID>/upgrade
After updating the database with the Redis Software API, update the REDB custom resource to reflect the change.