github.com/argoproj/argo-events@v1.9.1/docs/eventbus/antiaffinity.md (about)

     1  ## Anti-affinity
     2  
     3  Kubernetes offers a concept of [anti-affinity](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/), meaning that pods are scheduled on separate nodes. The anti-affinity can either be "best effort" or a hard requirement.
     4  
     5  A best effort and a hard requirement node anti-affinity config look like
     6    below, if you want to do AZ (Availability Zone) anti-affinity, change the value
     7    of `topologyKey` from `kubernetes.io/hostname` to
     8    `topology.kubernetes.io/zone`.
     9  
    10  ```yaml
    11  # Best effort
    12  affinity:
    13    podAntiAffinity:
    14      preferredDuringSchedulingIgnoredDuringExecution:
    15        - podAffinityTerm:
    16            labelSelector:
    17              matchLabels:
    18                controller: eventbus-controller
    19                eventbus-name: default
    20            topologyKey: kubernetes.io/hostname
    21          weight: 100
    22  ```
    23  
    24  ```yaml
    25  # Hard requirement
    26  affinity:
    27    podAntiAffinity:
    28      requiredDuringSchedulingIgnoredDuringExecution:
    29        - labelSelector:
    30            matchLabels:
    31              controller: eventbus-controller
    32              eventbus-name: default
    33          topologyKey: kubernetes.io/hostname
    34  ```