prometheus-operator / kube-prometheus

Use Prometheus to monitor Kubernetes and applications running on Kubernetes
https://prometheus-operator.dev/
Apache License 2.0
6.81k stars 1.94k forks source link

Support multiple antiAffinity statements #1090

Open bcbrockway opened 3 years ago

bcbrockway commented 3 years ago

What is missing?

We can't currently add affinityTerms using the provided "antiaffinity" function in addons/ because the function doesn't use the +: notation on the keys it creates. The podAntiAffinityTopologyKey key in values also only supports one topology key.

Why do we need it?

We would like to add an antiAffinity rule for zone, as well as hostname so that prometheus, alertmanager, etc. instances are put onto different hosts in different zones (the hostname rule would be a fallback if the zone rule was unable to be carried out).

Environment

Anything else we need to know?:

paulfantom commented 3 years ago

I agree it would be good to improve this addon. Do you want to contribute a fix?

slashpai commented 3 years ago

Not familiar with jsonnet yet but if you can give some starting points I can look at it :)