L
L
lugange2021-08-01 16:53:30
YAML
lugange, 2021-08-01 16:53:30

How to make multiple Pod Anti Affinity?

Is it possible to make several Pod Anti Affinity, I have a chart in which I want to specify several values ​​for anti affinity, there is a value file through which I deploy the application, in it I want to make variability for deployment, anti affinity itself looks like this:

affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: app.kubernetes.io/name
                operator: In
                values:
                - {{ include "vernemq.name" . }}
            topologyKey: "kubernetes.io/hostname"

affinity:
        podAntiAffinity2:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: app.kubernetes.io/name
                operator: In
                values:
                - {{ include "vernemq.name" . }}
                - kafka
            topologyKey: "kubernetes.io/hostname"


in values.yaml
podAntiAffinityPreset: hard2

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question