Skip to content

Install highly available Valkey with replication New#

  1. Generate a strong password to authenticate MSR 4 with Valkey:

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

    kubectl create secret generic msr-valkey-secret \
       --from-literal=REDIS_PASSWORD=${PASSWORD}
    

    Note

    MSR 4 requires REDIS_PASSWORD as the password field name.

  3. Deploy the Valkey instance:

    helm install msr-valkey oci://registry.mirantis.com/harbor/helm/mirantis-valkey/valkey \
        --set replica.enabled=true \
        --set replica.replicas=2 \
        --set auth.existingSecret=msr-valkey-secret \
        --set auth.existingSecretKey=REDIS_PASSWORD \
        --set replica.persistence.enabled=true \
        --set replica.persistence.size=10Gi \
        --set auth.enabled=true \
        --set "auth.aclUsers.default.password=${PASSWORD}" \
        --set "auth.aclUsers.default.permissions=~* &* +@all"
    

    Note

    • The replica.replicas value specifies the number of replica nodes in addition to the primary node. For example, a value of 2 deploys one primary node and two replica nodes.
    • Adjust the replica.persistence.size value based on your expected data volume and retention requirements.
  4. Retrieve the Valkey service port number:

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

Upgrade the highly available Valkey#

  1. Verify the Valkey version:

    kubectl get pod <Valkey Pod> -o jsonpath='{.spec.containers[*].image}'
    
  2. Upgrade Valkey:

    helm upgrade msr-valkey oci://registry.mirantis.com/harbor/helm/mirantis-valkey/valkey \
        --reuse-values \
        --set image.tag=<new tag>