Skip to content

Install highly available Valkey with replication#

Note

Replication is supported with Valkey Helm chart 0.12.1 and 1.0.0. The chart 1.0.0 values differ from the 0.12.1 values, so use the instructions for the chart version you install.

  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 \
        --version 0.12.1 \
        --set replica.enabled=true \
        --set replica.replicas=2 \
        --set replica.persistence.size=10Gi \
        --set auth.enabled=true \
        --set auth.usersExistingSecret=msr-valkey-secret \
        --set auth.aclUsers.default.passwordKey=REDIS_PASSWORD \
        --set "auth.aclUsers.default.permissions=~* &* +@all"
    

    Configuration considerations:

    • 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.
    • The auth.usersExistingSecret and auth.aclUsers.default.passwordKey values specify the secret and the key that store the Valkey password. These are the msr-valkey-secret secret and the REDIS_PASSWORD key that you created in step 2.
    • The replica.persistence.size value specifies the size of the persistent volume. Adjust it based on your expected data volume and retention requirements.
    helm install msr-valkey oci://registry.mirantis.com/harbor/helm/mirantis-valkey/valkey \
        --version 1.0.0 \
        --set replica.enabled=true \
        --set replica.replicas=3 \
        --set persistence.enabled=true \
        --set persistence.size=10Gi \
        --set auth.enabled=true \
        --set auth.usersExistingSecret=msr-valkey-secret \
        --set auth.aclUsers.default.passwordKey=REDIS_PASSWORD \
        --set "auth.aclUsers.default.permissions=~* &* +@all"
    

    Configuration considerations:

    • The replica.replicas value specifies the total number of Valkey nodes, including the primary node. For example, a value of 3 deploys one primary node and two replica nodes.
    • The auth.usersExistingSecret and auth.aclUsers.default.passwordKey values specify the secret and the key that store the Valkey password. These are the msr-valkey-secret secret and the REDIS_PASSWORD key that you created in step 2.
    • The persistence.size value specifies the size of the persistent volume. Adjust it 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}