From ad207775ff7157f9e2c9a7737ab27490014c058e Mon Sep 17 00:00:00 2001 From: Martin Magakian Date: Thu, 18 Nov 2021 11:08:36 +0100 Subject: [PATCH] Adding 'affinity' support to run 'descheduler' in CronJob or Deployment --- charts/descheduler/templates/cronjob.yaml | 4 ++++ charts/descheduler/templates/deployment.yaml | 4 ++++ charts/descheduler/values.yaml | 11 +++++++++++ 3 files changed, 19 insertions(+) diff --git a/charts/descheduler/templates/cronjob.yaml b/charts/descheduler/templates/cronjob.yaml index e7751434d..5624eb0b0 100644 --- a/charts/descheduler/templates/cronjob.yaml +++ b/charts/descheduler/templates/cronjob.yaml @@ -40,6 +40,10 @@ spec: nodeSelector: {{- toYaml . | nindent 12 }} {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 12 }} diff --git a/charts/descheduler/templates/deployment.yaml b/charts/descheduler/templates/deployment.yaml index c0b60c2c4..a464dfbed 100644 --- a/charts/descheduler/templates/deployment.yaml +++ b/charts/descheduler/templates/deployment.yaml @@ -68,6 +68,10 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} diff --git a/charts/descheduler/values.yaml b/charts/descheduler/values.yaml index b6b2a9bc2..5777a5a43 100644 --- a/charts/descheduler/values.yaml +++ b/charts/descheduler/values.yaml @@ -71,6 +71,17 @@ priorityClassName: system-cluster-critical nodeSelector: {} # foo: bar +affinity: {} +# nodeAffinity: +# requiredDuringSchedulingIgnoredDuringExecution: +# nodeSelectorTerms: +# - matchExpressions: +# - key: kubernetes.io/e2e-az-name +# operator: In +# values: +# - e2e-az1 +# - e2e-az2 + tolerations: [] # - key: 'management' # operator: 'Equal'