From 68d6e221a1043e1e8de59a49b9ba402f147acaf3 Mon Sep 17 00:00:00 2001 From: Sjouke de Vries Date: Thu, 29 Dec 2022 08:31:41 +0100 Subject: [PATCH] feat(helm): support affinity for longhornManager Signed-off-by: Sjouke de Vries --- chart/templates/daemonset-sa.yaml | 4 ++++ chart/templates/postupgrade-job.yaml | 4 ++++ chart/templates/uninstall-job.yaml | 4 ++++ chart/values.yaml | 12 ++++++++++++ 4 files changed, 24 insertions(+) diff --git a/chart/templates/daemonset-sa.yaml b/chart/templates/daemonset-sa.yaml index 63f98cd..c8798ef 100644 --- a/chart/templates/daemonset-sa.yaml +++ b/chart/templates/daemonset-sa.yaml @@ -117,6 +117,10 @@ spec: {{ toYaml .Values.longhornManager.nodeSelector | indent 8 }} {{- end }} {{- end }} + {{- if .Values.longhornManager.affinity }} + affinitiy: +{{ toYaml .Values.longhornManager.affinity | indent 8 }} + {{- end }} serviceAccountName: longhorn-service-account updateStrategy: rollingUpdate: diff --git a/chart/templates/postupgrade-job.yaml b/chart/templates/postupgrade-job.yaml index b9b2eeb..43c2ccc 100644 --- a/chart/templates/postupgrade-job.yaml +++ b/chart/templates/postupgrade-job.yaml @@ -56,3 +56,7 @@ spec: {{ toYaml .Values.longhornManager.nodeSelector | indent 8 }} {{- end }} {{- end }} + {{- if .Values.longhornManager.affinity }} + affinitiy: +{{ toYaml .Values.longhornManager.affinity | indent 8 }} + {{- end }} diff --git a/chart/templates/uninstall-job.yaml b/chart/templates/uninstall-job.yaml index 989933d..fd14954 100644 --- a/chart/templates/uninstall-job.yaml +++ b/chart/templates/uninstall-job.yaml @@ -57,3 +57,7 @@ spec: {{ toYaml .Values.longhornManager.nodeSelector | indent 8 }} {{- end }} {{- end }} + {{- if .Values.longhornManager.affinity }} + affinitiy: +{{ toYaml .Values.longhornManager.affinity | indent 8 }} + {{- end }} diff --git a/chart/values.yaml b/chart/values.yaml index 347035e..5e6873a 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -182,6 +182,18 @@ longhornManager: ## and uncomment this example block # label-key1: "label-value1" # label-key2: "label-value2" + affinity: {} + ## If you want to set nodeAffinity for Longhorn Manager DaemonSet, delete the `{}` in the line above + ## and uncomment this example block + # nodeAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # nodeSelectorTerms: + # - matchExpressions: + # - key: label-key1 + # operator: In + # values: + # - label-value1 + # - label-value2 serviceAnnotations: {} ## If you want to set annotations for the Longhorn Manager service, delete the `{}` in the line above ## and uncomment this example block