Install highly available Redis¶
Install the Redis Operator from the OT-Container-Kit Helm repository:
helm install redis-operator redis-operator \ --repo https://ot-container-kit.github.io/helm-charts
Generate a strong, random password for authenticating with Redis:
PASSWORD=$(LC_ALL=C tr -dc A-Za-z0-9 </dev/urandom | head -c 24)
Create a Kubernetes secret to securely store the password:
kubectl create secret generic msr-redis-secret \ --from-literal=REDIS_PASSWORD=${PASSWORD}
Deploy the Redis instance:
Note
Set
clusterSizeto the desired number of Redis nodes.helm install msr-redis redis-replication \ --repo https://ot-container-kit.github.io/helm-charts \ --set redisReplication.clusterSize=3 \ --set redisReplication.redisSecret.secretName=msr-redis-secret \ --set redisReplication.redisSecret.secretKey=REDIS_PASSWORD \ --set redisReplication.image=quay.io/opstree/redis \ --set redisReplication.tag=v8.2.2
Retrieve the connection details for the Redis service:
Get the service’s port number:
kubectl get svc msr-redis -o jsonpath={.spec.ports..port}
Upgrade highly available Redis¶
Verify Redis version:
kubectl get pod <Redis pod> -o jsonpath='{.spec.containers[*].image}'
Upgrade Redis:
helm upgrade msr-redis redis-replication \ --repo https://ot-container-kit.github.io/helm-charts \ --set redisReplication.clusterSize=3 \ --set redisReplication.redisSecret.secretName=msr-redis-secret \ --set redisReplication.redisSecret.secretKey=REDIS_PASSWORD \ --set redisReplication.image=quay.io/opstree/redis \ --set redisReplication.tag=v8.2.2
Note
Mirantis recommends installing Redis version 8.2.2 or the latest validated release. For more options, refer to the official redis-operator page.