PrefectHQ / prefect-helm

Helm charts for deploying Prefect Services
Apache License 2.0
101 stars 60 forks source link

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

Open marcincuber opened 4 months ago

marcincuber commented 4 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 4 months 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.

GuilleAmutio commented 1 month ago

hey @mitchnielsen, any updates on this feature? would be pretty useful. Will take a look at it in my free time to see if i can help with it

GuilleAmutio commented 1 month ago

PR created https://github.com/PrefectHQ/prefect-helm/pull/399

mitchnielsen commented 1 month ago

Much appreciated @GuilleAmutio, will take a look as soon as possible