pingidentity / helm-charts

Apache License 2.0
22 stars 31 forks source link

how to work with topologySpreadConstraints #272

Closed eikster-dk closed 1 year ago

eikster-dk commented 1 year ago

Hello

I want some guidance in settings the topologySpreadConstraints correctly for Directory and ping federate. Currently it requires you to set the match selectors manually and this requires you to hardcode the matchSelectors in the values file

Is there a way to get the matchLabels dynamically set to the same as the resulting workload labels?

example:

global:
  workload:
    topologySpreadConstraints:
      - topologyKey: topology.kubernetes.io/zone
        maxSkew: 3
        whenUnsatisfiable: DoNotSchedule
        labelSelector:
          matchLabels:
            app.kubernetes.io/name: xx
            app.kubernetes.io/instance: yyy
pingfederate-admin:
  enabled: true
pingfederate-engine:
  clustering:
    autoscaling:
      enabled: true
      minReplicas: 3
  enabled: true
..........
henryrecker-pingidentity commented 1 year ago

Right now there isn't a way to do this. The yaml block for topologySpreadConstraints is directly inserted into the yaml for the Deployment or Statefulset.

eikster-dk commented 1 year ago

@henryrecker-pingidentity is this something ping identity is up for discussing on how to improve, so it can run through the template engine or somehow improved so we don't have to use hardcode it?

henryrecker-pingidentity commented 1 year ago

@eikster-dk Yes, I'll open an issue internally to improve this.

timothynguyen90 commented 1 year ago

Updated workload to have matchLabels use the default labels.

henryrecker-pingidentity commented 1 year ago

@eikster-dk These labels should now be setting automatically to match the workload with the new 0.9.12 release.