From 948f825ec6ea426de369ead28a51f9e082841d78 Mon Sep 17 00:00:00 2001 From: Dominic DePasquale <7384087+domdepasquale@users.noreply.github.com> Date: Fri, 19 Apr 2024 15:00:32 -0400 Subject: [PATCH] extra configs (#75) * apps: allow mounting of arbigrary configmaps and secrets as envvars * bump chart --- charts/application-core/Chart.yaml | 2 +- .../templates/deployment.yaml | 20 +++++++++++++++++-- charts/application-core/values.yaml | 4 ++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/charts/application-core/Chart.yaml b/charts/application-core/Chart.yaml index 0ed2061..c6bc99a 100644 --- a/charts/application-core/Chart.yaml +++ b/charts/application-core/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 3.0.4 +version: 3.1.0 maintainers: - name: Dominic DePasquale diff --git a/charts/application-core/templates/deployment.yaml b/charts/application-core/templates/deployment.yaml index 1870487..ab16962 100644 --- a/charts/application-core/templates/deployment.yaml +++ b/charts/application-core/templates/deployment.yaml @@ -58,7 +58,7 @@ spec: - {{ . }} {{- end }} {{- end }} - {{- if or .Values.externalSecret.enabled .Values.configMap.enabled }} + {{- if or .Values.externalSecret.enabled .Values.configMap.enabled .Values.extraConfigMaps .Values.extraSecrets }} envFrom: {{- if .Values.configMap.enabled }} - configMapRef: @@ -68,6 +68,14 @@ spec: - secretRef: name: {{ include "application-core.fullname" . }}-config {{- end }} + {{- range $configMap := .Values.extraConfigMaps }} + - configMapRef: + name: {{ $configMap }} + {{- end }} + {{- range $secret := .Values.extraSecrets }} + - secretRef: + name: {{ $secret }} + {{- end }} {{- end }} resources: {{- toYaml .Values.initContainer.resources | nindent 12 }} @@ -101,7 +109,7 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} {{- end }} - {{- if or .Values.externalSecret.enabled .Values.configMap.enabled }} + {{- if or .Values.externalSecret.enabled .Values.configMap.enabled .Values.extraConfigMaps .Values.extraSecrets }} envFrom: {{- if .Values.configMap.enabled }} - configMapRef: @@ -111,6 +119,14 @@ spec: - secretRef: name: {{ include "application-core.fullname" . }}-config {{- end }} + {{- range $configMap := .Values.extraConfigMaps }} + - configMapRef: + name: {{ $configMap }} + {{- end }} + {{- range $secret := .Values.extraSecrets }} + - secretRef: + name: {{ $secret }} + {{- end }} {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/charts/application-core/values.yaml b/charts/application-core/values.yaml index 772e558..8ad6523 100644 --- a/charts/application-core/values.yaml +++ b/charts/application-core/values.yaml @@ -86,6 +86,10 @@ configMap: enabled: false data: {} +# extraConfigMaps and extraSecrets to be mounted as envFrom +extraConfigMaps: [] +extraSecrets: [] + externalSecret: enabled: false data: []