Skip to content

Install highly available Redis with replication#

  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=v7.2.13
    
  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=v7.2.13
    

    Note

    Mirantis recommends Redis 7.2.11 or later within 7.2.x branch. The validated versions are 7.2.11, 7.2.12, and 7.2.13. For the full list of available versions, see the redis-operator page.