Install highly available Redis

  1. 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
    
  2. Generate a strong, random password for authenticating with Redis:

    PASSWORD=$(LC_ALL=C tr -dc A-Za-z0-9 </dev/urandom | head -c 24)
    
  3. Create a Kubernetes secret to securely store the password:

    kubectl create secret generic msr-redis-secret \
      --from-literal=REDIS_PASSWORD=${PASSWORD}
    
  4. 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
    
  5. Retrieve connection details for the Redis service:

    Get the service’s port number:

    kubectl get svc msr-redis -o jsonpath={.spec.ports..port}