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
clusterSize
to the desired number of Redis nodes.helm upgrade -i 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
Retrieve connection details for the Redis service:
Get the service’s port number:
kubectl get svc msr-redis -o jsonpath={.spec.ports..port}