mq-helm icon indicating copy to clipboard operation
mq-helm copied to clipboard

Support topologySpreadConstraints

Open robert-mcnamara opened this issue 1 year ago • 2 comments

Hi,

In order to guarantee that a replica don't get scheduled in the same zone and node as another, we need to be able to specify topologySpreadConstraints.

I am happy to contribute back this change to the project.

robert-mcnamara avatar May 23 '24 10:05 robert-mcnamara

This Helm chart uses a StatefulSet. If you use the topology.kubernetes.io/zone label on your Node resources as is common, then the Kubernetes scheduler will automatically spread the Pods in the StatefulSet across the zones.

I think the default behaviour is what most people are after though, without any of the additional complexity of topologySpreadConstraints. Is there any additional control that you specifically need, or does the above cover it?

arthurbarr avatar May 23 '24 12:05 arthurbarr

This Helm chart uses a StatefulSet. If you use the topology.kubernetes.io/zone label on your Node resources as is common, then the Kubernetes scheduler will automatically spread the Pods in the StatefulSet across the zones.

I think the default behaviour is what most people are after though, without any of the additional complexity of topologySpreadConstraints. Is there any additional control that you specifically need, or does the above cover it?

Thanks for the response. As far as I understand this is a best effort on the part of the Kubernetes scheduler and can lead to an uneven distribution of pods across zones. It would be a better guarantee to use the topologySpreadConstraints and conditionally include if it needs to be configured.

robert-mcnamara avatar May 23 '24 13:05 robert-mcnamara

Closing as addressed in #97

callumpjackson avatar Sep 26 '24 12:09 callumpjackson