From e819728f68818ad3185d28861b34a8ce1cca1e32 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Wed, 28 Jun 2023 14:13:43 +0200 Subject: [PATCH] feat(orggatekeeper): [#48311] template environment variables directly Previously, environment variables were templated into a ConfigMap which was referenced through an `envFrom` in the deployment. Unfortunately, Kubernetes does not restart deployments on changes to their referenced ConfigMaps[1], so this indirection means that deployments have to be restarted manually every time a change is made - something that is very easy to forget in an otherwise GitOpsy workflow. [1] https://github.com/kubernetes/kubernetes/issues/22368 --- .../integrations/orggatekeeper/configmap.yaml | 16 ---------------- .../integrations/orggatekeeper/deployment.yaml | 7 ++++--- 2 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 os2mo/templates/integrations/orggatekeeper/configmap.yaml diff --git a/os2mo/templates/integrations/orggatekeeper/configmap.yaml b/os2mo/templates/integrations/orggatekeeper/configmap.yaml deleted file mode 100644 index abf6ad9..0000000 --- a/os2mo/templates/integrations/orggatekeeper/configmap.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-FileCopyrightText: Magenta ApS -# -# SPDX-License-Identifier: MPL-2.0 ---- -{{- if .Values.orggatekeeper.enabled }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: orggatekeeper-config - {{- with .Values.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -data: -{{ toYaml .Values.orggatekeeper.environment | indent 2 }} -{{- end }} diff --git a/os2mo/templates/integrations/orggatekeeper/deployment.yaml b/os2mo/templates/integrations/orggatekeeper/deployment.yaml index 332e16b..65226db 100644 --- a/os2mo/templates/integrations/orggatekeeper/deployment.yaml +++ b/os2mo/templates/integrations/orggatekeeper/deployment.yaml @@ -59,9 +59,10 @@ spec: - name: SENTRY_ENVIRONMENT value: {{ .Values.sentry.environment | quote }} {{ end }} - envFrom: - - configMapRef: - name: orggatekeeper-config + {{- range $name, $value := .Values.orggatekeeper.environment }} + - name: {{ $name }} + value: {{ $value | quote }} + {{- end }} ports: - containerPort: 8000 resources: