From 1381513b0d1d1e54aa9cdde525dc2d37cc722d38 Mon Sep 17 00:00:00 2001 From: "bo.kristoffersson" Date: Fri, 12 Nov 2021 16:09:20 +0100 Subject: [PATCH 1/2] support for environment variables in configMap --- idsvr/templates/deployment-admin.yaml | 8 +++++++- idsvr/templates/deployment-runtime.yaml | 8 +++++++- idsvr/values.yaml | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/idsvr/templates/deployment-admin.yaml b/idsvr/templates/deployment-admin.yaml index a0349c5..30dd1a5 100644 --- a/idsvr/templates/deployment-admin.yaml +++ b/idsvr/templates/deployment-admin.yaml @@ -54,11 +54,17 @@ spec: - name: {{ $env.name }} value: {{ $env.value | quote }} {{- end }} - {{- if .Values.curity.config.environmentVariableSecret }} + {{- if or ( .Values.curity.config.environmentVariableSecret .Values.curity.config.environmentVariableConfigMap )}} envFrom: + {{- if .Values.curity.config.environmentVariableConfigMap }} + - configMapRef: + name: {{ .Values.curity.config.environmentVariableConfigMap | quote }} + {{- end }} + {{- if .Values.curity.config.environmentVariableSecret }} - secretRef: name: {{ .Values.curity.config.environmentVariableSecret | quote }} {{- end }} + {{- end }} ports: - name: config-port containerPort: {{ .Values.curity.admin.service.port }} diff --git a/idsvr/templates/deployment-runtime.yaml b/idsvr/templates/deployment-runtime.yaml index ad8b467..a5520b1 100644 --- a/idsvr/templates/deployment-runtime.yaml +++ b/idsvr/templates/deployment-runtime.yaml @@ -40,11 +40,17 @@ spec: - name: {{ $env.name }} value: {{ $env.value | quote }} {{- end }} - {{- if .Values.curity.config.environmentVariableSecret }} + {{- if or ( .Values.curity.config.environmentVariableSecret .Values.curity.config.environmentVariableConfigMap ) }} envFrom: + {{- if .Values.curity.config.environmentVariableConfigMap }} + - configMapRef: + name: {{ .Values.curity.config.environmentVariableConfigMap | quote }} + {{- end }} + {{- if .Values.curity.config.environmentVariableSecret }} - secretRef: name: {{ .Values.curity.config.environmentVariableSecret | quote }} {{- end }} + {{- end }} ports: - name: http-port containerPort: {{ .Values.curity.runtime.deployment.port }} diff --git a/idsvr/values.yaml b/idsvr/values.yaml index c416172..16d52a9 100644 --- a/idsvr/values.yaml +++ b/idsvr/values.yaml @@ -96,6 +96,7 @@ curity: password: encryptionKey: environmentVariableSecret: + environmentVariableConfigMap: configurationConfigMap: configurationConfigMapItemName: configurationSecret: From a17e40e8a300707087ec3c8ace21c7a0cfe3994b Mon Sep 17 00:00:00 2001 From: "bo.kristoffersson" Date: Fri, 12 Nov 2021 16:28:52 +0100 Subject: [PATCH 2/2] add documentation --- idsvr/README.md | 3 ++- idsvr/templates/deployment-admin.yaml | 2 +- idsvr/templates/deployment-runtime.yaml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/idsvr/README.md b/idsvr/README.md index 99bbb9a..ba8207b 100644 --- a/idsvr/README.md +++ b/idsvr/README.md @@ -92,7 +92,8 @@ Parameter | Description | Default `curity.config.uiEnabled`| Flag to enable/disable the service for Admin UI and Admin REST API |`false` `curity.config.password`| The administrator password. Required if `curity.config.environmentVariableSecret` and `curity.config.configurationSecret` is not set | `null` `curity.config.encryptionKey`| The configuration encryption key |`null` -`curity.config.environmentVariableSecret`| The data from this Secret will be mounted as environment variables |`null` +`curity.config.environmentVariableSecret`| The data from this Secret will be mounted as environment variables |`null` +`curity.config.environmentVariableConfigMap`| The data from this ConfigMap will be mounted as environment variables |`null` `curity.config.configurationSecret`| The Secret containing configuration which is mounted as a volume |`null` `curity.config.configurationSecretItemName`| The `curity.config.configurationSecret`'s item name, required if the Secret is set. |`null` `curity.config.configurationConfigMap`| The ConfigMap containing configuration which is mounted as a volume |`null` diff --git a/idsvr/templates/deployment-admin.yaml b/idsvr/templates/deployment-admin.yaml index 30dd1a5..64beb7a 100644 --- a/idsvr/templates/deployment-admin.yaml +++ b/idsvr/templates/deployment-admin.yaml @@ -54,7 +54,7 @@ spec: - name: {{ $env.name }} value: {{ $env.value | quote }} {{- end }} - {{- if or ( .Values.curity.config.environmentVariableSecret .Values.curity.config.environmentVariableConfigMap )}} + {{- if ( or .Values.curity.config.environmentVariableSecret .Values.curity.config.environmentVariableConfigMap ) }} envFrom: {{- if .Values.curity.config.environmentVariableConfigMap }} - configMapRef: diff --git a/idsvr/templates/deployment-runtime.yaml b/idsvr/templates/deployment-runtime.yaml index a5520b1..f4ebc1d 100644 --- a/idsvr/templates/deployment-runtime.yaml +++ b/idsvr/templates/deployment-runtime.yaml @@ -40,7 +40,7 @@ spec: - name: {{ $env.name }} value: {{ $env.value | quote }} {{- end }} - {{- if or ( .Values.curity.config.environmentVariableSecret .Values.curity.config.environmentVariableConfigMap ) }} + {{- if ( or .Values.curity.config.environmentVariableSecret .Values.curity.config.environmentVariableConfigMap ) }} envFrom: {{- if .Values.curity.config.environmentVariableConfigMap }} - configMapRef: