Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying topologySpreadConstraints on StatefulSet #75

Open
vitorstone opened this issue Apr 22, 2024 · 0 comments
Open

Allow specifying topologySpreadConstraints on StatefulSet #75

vitorstone opened this issue Apr 22, 2024 · 0 comments

Comments

@vitorstone
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant