Skip to content

Configuration

Andrei Dobre edited this page Sep 25, 2020 · 7 revisions

Redis operator configuration

How are pods scheduled?

The Redis nodes are scheduled on K8s nodes according to the following rules:

For the leader:

podAntiAffinity:
  requiredDuringSchedulingIgnoredDuringExecution:
  - labelSelector:
      matchExpressions:
      - key: "app"
        operator: In
        values:
        - "redis"
    topologyKey: "kubernetes.io/hostname"
  preferredDuringSchedulingIgnoredDuringExecution:
  - weight: 100
    podAffinityTerm:
      labelSelector:
        matchExpressions:
        - key: "redis-node-role"
          operator: In
          values:
          - "leader"
      topologyKey: "failure-domain.beta.kubernetes.io/zone"

For the slaves:

podAntiAffinity:
  requiredDuringSchedulingIgnoredDuringExecution:
  - labelSelector:
      matchExpressions:
      - key: "app"
        operator: In
        values:
        - "redis"
    topologyKey: "kubernetes.io/hostname"
  preferredDuringSchedulingIgnoredDuringExecution:
  - weight: 100
    podAffinityTerm:
      labelSelector:
        matchExpressions:
        - key: "redis-node-role"
          operator: In
          values:
          - "leader"
        - key: "redis-cluster-id"
          operator: In
          values:
          - <cluster-id>
      topologyKey: "failure-domain.beta.kubernetes.io/zone"
Clone this wiki locally