From 414836b358603c84f9e0e392d0e3d3464c287e44 Mon Sep 17 00:00:00 2001 From: lijianguo Date: Wed, 16 Mar 2022 17:45:22 +0800 Subject: [PATCH] feat(helmbroker): add affinity --- charts/helmbroker/templates/helmbroker-celery.yaml | 5 ++++- charts/helmbroker/templates/helmbroker-deployment.yaml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/charts/helmbroker/templates/helmbroker-celery.yaml b/charts/helmbroker/templates/helmbroker-celery.yaml index e9d7915..816d858 100644 --- a/charts/helmbroker/templates/helmbroker-celery.yaml +++ b/charts/helmbroker/templates/helmbroker-celery.yaml @@ -22,6 +22,9 @@ spec: app: drycc-helmbroker-celery spec: serviceAccount: drycc-helmbroker + {{- if .Values.global.common }} + {{- include "common.affinity" (dict "key" "app" "values" (list "drycc-helmbroker-celery")) | indent 6 }} + {{- end }} containers: - name: drycc-helmbroker-celery image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/helmbroker:{{.Values.imageTag}} @@ -33,4 +36,4 @@ spec: {{- include "helmbroker.limits" . | indent 10 }} {{- include "helmbroker.envs" . | indent 10 }} {{- include "helmbroker.volumeMounts" . | indent 10 }} - {{- include "helmbroker.volumes" . | indent 6 }} \ No newline at end of file + {{- include "helmbroker.volumes" . | indent 6 }} diff --git a/charts/helmbroker/templates/helmbroker-deployment.yaml b/charts/helmbroker/templates/helmbroker-deployment.yaml index cc1c03e..9e48b07 100644 --- a/charts/helmbroker/templates/helmbroker-deployment.yaml +++ b/charts/helmbroker/templates/helmbroker-deployment.yaml @@ -21,6 +21,9 @@ spec: labels: app: drycc-helmbroker spec: + {{- if .Values.global.common }} + {{- include "common.affinity" (dict "key" "app" "values" (list "drycc-helmbroker")) | indent 6 }} + {{- end }} serviceAccount: drycc-helmbroker initContainers: - name: loader @@ -55,4 +58,4 @@ spec: {{- include "helmbroker.limits" . | indent 10 }} {{- include "helmbroker.envs" . | indent 10 }} {{- include "helmbroker.volumeMounts" . | indent 10 }} - {{- include "helmbroker.volumes" . | indent 6 }} \ No newline at end of file + {{- include "helmbroker.volumes" . | indent 6 }}