PrefectHQ / prefect-helm

Helm charts for deploying Prefect Services
Apache License 2.0
93 stars 56 forks source link

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

Open marcincuber opened 2 months ago

marcincuber commented 2 months ago

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
mitchnielsen commented 1 month ago

Thanks for reaching out @marcincuber. I'm open to having this configuration exposed when provided. Any interest in contributing the change? If not, we'll get to this eventually.