Skip to content
English
  • There are no suggestions because the search field is empty.

Configuring Redis in High Availability Mode

Redis High Availability (HA) is currently in Experimental mode, therefore is not fully supported and have the following limitations:

  • No more than 1 master can be deployed per Kubernetes node

  • Replicas and writers can only see the single master of their own Kubernetes node

To achieve HA, the following parameters have to be set:

  1. redis.master.count should be less or equal the number of nodes in the Kubernetes cluster

  2. redis.replica.replicaCount should be more or equal to redis.master.count

  3. redis.master.service.internalTrafficPolicy should be set to Local in order to limit replica and master communication within their own Kubernetes node

  4. redis.master.topologySpreadConstraints and redis.master.affinity should be set in order to allow only 1 replica per node

     
    affinity: podAntiAffinityPreset: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchLabels: app.kubernetes.io/name: redis app.kubernetes.io/component: master topologyKey: kubernetes.io/hostname ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity topologySpreadConstraints: - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app.kubernetes.io/name: redis app.kubernetes.io/component: master ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
  5. redis.replica.affinity should be set in order to match the setup of the master nodes

     
    affinity: podAffinityPreset: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchLabels: app.kubernetes.io/name: redis app.kubernetes.io/component: master topologyKey: kubernetes.io/hostname ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
  6. redis.replica.topologySpreadConstaints should be set accordingly to the number of replicas desired in a single node:

     
    topologySpreadConstraints: - maxSkew: 1 topologyKey: topology.kubernetes.io/zone whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app.kubernetes.io/name: redis app.kubernetes.io/component: replica ## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/