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

[feature] Add support for topology-spread-constraints in helm chart

Open marcincuber opened this issue 7 months ago • 1 comments

It would be nice to add support for topology-spread-constraints to spread pod across different nodes and zones. I find it much easier and cleaner to use compared to affinity and antiaffinity rules. I think it would be a useful (non essential) addition.

 topologySpreadConstraints:
        - maxSkew: 1
          topologyKey: kubernetes.io/hostname
          whenUnsatisfiable: DoNotSchedule
          labelSelector:
            matchLabels:
              app.kubernetes.io/name: prefect-worker

vs

affinity:
      podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                  - key: app.kubernetes.io/name
                    operator: In
                    values:
                      - prefect-worker
              topologyKey: kubernetes.io/hostname

marcincuber avatar Jul 16 '24 15:07 marcincuber