From 6d4deaf5198b01bcf27b4c5ddf93f7e24e3e0313 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Wed, 28 Jun 2023 14:12:45 +0200 Subject: [PATCH] feat(sdtool): [#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 --- .../templates/integrations/sdtool/configmap.yaml | 16 ---------------- .../integrations/sdtool/deployment.yaml | 7 ++++--- 2 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 os2mo/templates/integrations/sdtool/configmap.yaml diff --git a/os2mo/templates/integrations/sdtool/configmap.yaml b/os2mo/templates/integrations/sdtool/configmap.yaml deleted file mode 100644 index 6aeb7af..0000000 --- a/os2mo/templates/integrations/sdtool/configmap.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-FileCopyrightText: Magenta ApS -# -# SPDX-License-Identifier: MPL-2.0 ---- -{{- if .Values.sdtool.enabled }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: sdtool-config - {{- with .Values.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -data: -{{ toYaml .Values.sdtool.environment | indent 2 }} -{{- end }} diff --git a/os2mo/templates/integrations/sdtool/deployment.yaml b/os2mo/templates/integrations/sdtool/deployment.yaml index e8246ec..78aec04 100644 --- a/os2mo/templates/integrations/sdtool/deployment.yaml +++ b/os2mo/templates/integrations/sdtool/deployment.yaml @@ -74,9 +74,10 @@ spec: - name: SD_TOO_DEEP value: {{ .Values.sdtool.sd_too_deep | quote }} - envFrom: - - configMapRef: - name: sdtool-config + {{- range $name, $value := .Values.sdtool.environment }} + - name: {{ $name }} + value: {{ $value | quote }} + {{- end }} ports: - containerPort: 80 resources: