From f88b298a3f72a4433940aefe4468cd85ff95e6aa Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Wed, 28 Jun 2023 14:15:43 +0200 Subject: [PATCH] feat(manager elevator): [#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 --- .../manager-engagement-elevator/config.yaml | 16 ---------------- .../manager-engagement-elevator/deployment.yaml | 8 ++++---- 2 files changed, 4 insertions(+), 20 deletions(-) delete mode 100644 os2mo/templates/integrations/manager-engagement-elevator/config.yaml diff --git a/os2mo/templates/integrations/manager-engagement-elevator/config.yaml b/os2mo/templates/integrations/manager-engagement-elevator/config.yaml deleted file mode 100644 index 9c6624a..0000000 --- a/os2mo/templates/integrations/manager-engagement-elevator/config.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# SPDX-FileCopyrightText: Magenta ApS -# -# SPDX-License-Identifier: MPL-2.0 ---- -{{- if .Values.manager_engagement_elevator.enabled }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: manager-engagement-elevator-config - {{- with .Values.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -data: -{{ toYaml .Values.manager_engagement_elevator.environment | indent 2 }} -{{- end }} diff --git a/os2mo/templates/integrations/manager-engagement-elevator/deployment.yaml b/os2mo/templates/integrations/manager-engagement-elevator/deployment.yaml index 14201ce..1944cbd 100644 --- a/os2mo/templates/integrations/manager-engagement-elevator/deployment.yaml +++ b/os2mo/templates/integrations/manager-engagement-elevator/deployment.yaml @@ -54,10 +54,10 @@ spec: - name: SENTRY_ENVIRONMENT value: {{ .Values.sentry.environment | quote }} {{ end }} - envFrom: - # The configMap is capable of handling JSON ENVs - - configMapRef: - name: manager-engagement-elevator-config + {{- range $name, $value := .Values.manager_engagement_elevator.environment }} + - name: {{ $name }} + value: {{ $value | quote }} + {{- end }} ports: - containerPort: 8000 resources: