Upgrading Redis and RedisCluster
The upgrade strategy for standalone Redis includes the downtime of the system but for cluster setup mode any application will not face any type of issues or downtime. The operator uses the rolling deployment strategy for cluster setup where it will upgrade the redis leader pods and once the leader is upgraded it will follow the same strategy for redis follower pods.
Upgrade of standalone setup
For upgrading the standalone setup of Redis, first we need to identify the current version of it and that can be done via combination of kubectl
and redis-server
command.
Now let’s say the new version, we want to migrate is 7.0.5
. In that case, we can simply use helm upgrade
command to upgrade the redis cluster.
Once the upgrade strategy is completed, we can verify the redis pod status by executing:
Verify the version of redis pod by using the same cli command.
For YAML manifest based upgrade, please update the spec
section of Redis Object. For further details check here.
Things to keep in mind:
Note
- Standalone upgrade introduces downtime, so make sure you have strategy in-place. A better option could be deploying a new redis standalone alongside and point the application to it.
- Your applications should be compatible with the new version of Redis on which you are upgrading.
Upgrading cluster setup
Similar to standalone setup upgrade, the cluster setup upgrade can also be performed by helm
command. But again first we need to verify the version of existing cluster setup.
As an initial step of Redis cluster upgrade, first we need to check the version of redis
and also the health of cluster. Again this can be achieved by kubectl
and redis-cli
.
Once the version and cluster health is verified, we can trigger the upgrade of the cluster by using helm
command. Let’s upgrade the cluster version to v7.
Once the upgrade using helm is completed, we need to verify the redis cluster pod status. Also, we need to check the version and health of redis cluster to verify the upgrade is successful or not.
For YAML manifest based upgrade, please update the spec
section of Redis Object. For further details check here.
Things to keep in mind:
Note
- Cluster upgrade doesn’t cause any kind of downtime because of rolling update strategy of Kubernetes, there will be always a redis available to serve application requests.
- If application is highly critical, in such scenarios it would make sense to create a new cluster and migrate the application pointing to it