<p>I'm running the redis chart (<a href="https://artifacthub.io/packages/helm/bitnami/redis/15.7.0" rel="nofollow noreferrer">https://artifacthub.io/packages/helm/bitnami/redis/15.7.0</a>) as a dependency of a custom chart. I enabled sentinel, then the pods are running two containers (redis and sentinel).
I'm using the default values for the chart and I defined 4 replicas. The cluster have 10 nodes and I notice that three redis-sentinel's pods run on a single node and only one runs in another node:</p>
<pre><code>myapp-redis-node-0    2/2    Running    8d     ip    k8s-appname-ctw9v
myapp-redis-node-1    2/2    Running    34d    ip    k8s-appname-ctw9v
myapp-redis-node-2    2/2    Running    34d    ip    k8s-appname-ctw9v
myapp-redis-node-3    2/2    Running    34d    ip    k8s-appname-crm3k
</code></pre>
<p>This is the affinity section for the pod's:</p>
<pre><code>spec:
  affinity:
    podAntiAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - podAffinityTerm:
          labelSelector:
            matchLabels:
              app.kubernetes.io/component: node
              app.kubernetes.io/instance: myapp
              app.kubernetes.io/name: redis
          namespaces:
          - test
          topologyKey: kubernetes.io/hostname
        weight: 1
</code></pre>
<p>How I can do to have each pod on diferent nodes?</p>
<p>Thanks!</p>

<p>You need to update the <code>podAntiAffinity</code> section of the pod template to add a certain k/v pair. This will ensure that for a node, if a pod with that k/v pair already exists, the schedular will attempt to schedule the pod on another node that doesn't have a pod with that k/v pair. I say attempt, because anti-affinity rules are <code>soft</code> rules and if there are no nodes available, a pod will be scheduled on a node that might possibly violate the anti-affinity. Details <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#types-of-inter-pod-affinity-and-anti-affinity" rel="nofollow noreferrer">here</a>.</p>
<p>Try patching the template as:</p>
<pre><code>spec:
  affinity:
    podAntiAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          labelSelector:
            matchExpressions:
            - key: &lt;ADD_LABEL_HERE&gt;
              operator: In
              values:
              - &lt;ADD_VALUE_HERE&gt;
</code></pre>
