diff --git a/charts/descheduler/README.md b/charts/descheduler/README.md index 96296ef3b4..05862be911 100644 --- a/charts/descheduler/README.md +++ b/charts/descheduler/README.md @@ -84,6 +84,7 @@ The following table lists the configurable parameters of the _descheduler_ chart | `serviceMonitor.metricRelabelings` | MetricRelabelConfigs to apply to samples after scraping, but before ingestion | `[]` | | `serviceMonitor.relabelings` | RelabelConfigs to apply to samples before scraping | `[]` | | `affinity` | Node affinity to run the descheduler cronjob/deployment on specific nodes | `nil` | +| `topologySpreadConstraints` | Topology Spread Constraints to spread the descheduler cronjob/deployment across the cluster | `[]` | | `tolerations` | tolerations to run the descheduler cronjob/deployment on specific nodes | `nil` | | `suspend` | Set spec.suspend in descheduler cronjob | `false` | | `commonLabels` | Labels to apply to all resources | `{}` | diff --git a/charts/descheduler/templates/cronjob.yaml b/charts/descheduler/templates/cronjob.yaml index 6a7a6b662c..25d323eb6c 100644 --- a/charts/descheduler/templates/cronjob.yaml +++ b/charts/descheduler/templates/cronjob.yaml @@ -51,6 +51,10 @@ spec: affinity: {{- toYaml . | nindent 12 }} {{- end }} + {{- with .Values.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 12 }} + {{- end }} {{- if .Values.dnsConfig }} dnsConfig: {{- .Values.dnsConfig | toYaml | nindent 12 }} diff --git a/charts/descheduler/templates/deployment.yaml b/charts/descheduler/templates/deployment.yaml index a00ab7bc6f..bc16eb5ea5 100644 --- a/charts/descheduler/templates/deployment.yaml +++ b/charts/descheduler/templates/deployment.yaml @@ -80,6 +80,10 @@ spec: affinity: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} diff --git a/charts/descheduler/values.yaml b/charts/descheduler/values.yaml index 0500c34624..9e968bbd08 100644 --- a/charts/descheduler/values.yaml +++ b/charts/descheduler/values.yaml @@ -149,6 +149,13 @@ affinity: {} # values: # - descheduler # topologyKey: "kubernetes.io/hostname" +topologySpreadConstraints: [] +# - maxSkew: 1 +# topologyKey: kubernetes.io/hostname +# whenUnsatisfiable: DoNotSchedule +# labelSelector: +# matchLabels: +# app.kubernetes.io/name: descheduler tolerations: [] # - key: 'management' # operator: 'Equal'