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 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
    
  5. 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

  1. Verify Redis version:

    kubectl get pod <Redis pod> -o jsonpath='{.spec.containers[*].image}'
    
  2. 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.