sonatype / nxrm3-ha-repository

Repository for YAML configuration files for Nexus Repository Manager High Availability Feature
17 stars 23 forks source link

Allow specifying `topologySpreadConstraints` on StatefulSet #75

Open vitorstone opened 5 months ago

vitorstone commented 5 months ago

In my StatefulSet I want to be able to add this block of code:

topologySpreadConstraints:
    - maxSkew: 1
      topologyKey: topology.kubernetes.io/zone
      whenUnsatisfiable: ScheduleAnyway
      labelSelector:
        matchLabels:
          app: nexus
    - maxSkew: 1
      topologyKey: kubernetes.io/hostname
      whenUnsatisfiable: ScheduleAnyway
      labelSelector:
        matchLabels:
          app: nexus

PS: The matchLabels part would be different but you get the gist.

The reason for that is because we've labeled our k8s nodes with topology.kubernetes.io/zone and kubernetes.io/hostname so that the pods can be created on different nodes and different zones, if possible.