From b53cf71a9c3b99fd6d754cd03578318343f44edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Vall=C3=A9s?= Date: Mon, 3 Jun 2024 08:35:46 +0200 Subject: [PATCH] feat: run migration only on main cluster in mgmt-backend --- charts/core/templates/mgmt-backend/deployment.yaml | 2 ++ charts/core/values.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/charts/core/templates/mgmt-backend/deployment.yaml b/charts/core/templates/mgmt-backend/deployment.yaml index a52e41ca..9b2a22fd 100644 --- a/charts/core/templates/mgmt-backend/deployment.yaml +++ b/charts/core/templates/mgmt-backend/deployment.yaml @@ -76,6 +76,7 @@ spec: - name: TEMPORAL_CLI_ADDRESS value: "{{ template "core.temporal" . }}-frontend:{{ template "core.temporal.frontend.grpcPort" . }}" {{- end }} + {{- if .Values.isPrimaryCluster }} - name: mgmt-backend-migration image: {{ .Values.mgmtBackend.image.repository }}:{{ .Values.mgmtBackend.image.tag }} imagePullPolicy: {{ .Values.mgmtBackend.image.pullPolicy }} @@ -91,6 +92,7 @@ spec: {{- with .Values.mgmtBackend.extraVolumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} + {{- end }} - name: mgmt-backend-init image: {{ .Values.mgmtBackend.image.repository }}:{{ .Values.mgmtBackend.image.tag }} imagePullPolicy: {{ .Values.mgmtBackend.image.pullPolicy }} diff --git a/charts/core/values.yaml b/charts/core/values.yaml index 4c2811da..b0c74b95 100644 --- a/charts/core/values.yaml +++ b/charts/core/values.yaml @@ -11,6 +11,8 @@ updateStrategy: rollingUpdate: maxSurge: 1 maxUnavailable: 0 +# -- Set the cluster as the primary one in a multi-region environment. +isPrimaryCluster: true # -- Logging level: debug, info, warning, error or fatal logLevel: info # -- Enable development mode