From a837bd8e4eddadd1ebf361244c8b25d03ffe31d7 Mon Sep 17 00:00:00 2001 From: Guillaume Veschambre Date: Thu, 14 Nov 2024 09:36:04 -0500 Subject: [PATCH] Add extraEnvFromSecrets value to db chart Signed-off-by: Guillaume Veschambre --- aidbox/templates/_helpers.tpl | 9 --------- aidbox/templates/deployment.yaml | 2 +- aidbox/templates/secrets.yaml | 2 -- aidbox/values.yaml | 3 --- aidboxdb/templates/_helpers.tpl | 10 ---------- aidboxdb/templates/secrets.yaml | 2 -- aidboxdb/templates/statefulset.yaml | 6 +++++- aidboxdb/values.yaml | 5 ++--- 8 files changed, 8 insertions(+), 31 deletions(-) diff --git a/aidbox/templates/_helpers.tpl b/aidbox/templates/_helpers.tpl index b12eed0..090fcc4 100644 --- a/aidbox/templates/_helpers.tpl +++ b/aidbox/templates/_helpers.tpl @@ -60,12 +60,3 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} - -{{/* Create the secret name for Aidbox, using existingSecret if set */}} -{{- define "aidbox.secretName" -}} -{{- if .Values.auth.existingSecret -}} -{{ .Values.auth.existingSecret }} -{{- else -}} -{{ include "aidbox.fullname" . }} -{{- end -}} -{{- end -}} \ No newline at end of file diff --git a/aidbox/templates/deployment.yaml b/aidbox/templates/deployment.yaml index 89e4318..4c4b6f3 100644 --- a/aidbox/templates/deployment.yaml +++ b/aidbox/templates/deployment.yaml @@ -32,7 +32,7 @@ spec: - configMapRef: name: {{ include "aidbox.fullname" . }} - secretRef: - name: {{ include "aidbox.secretName" . }} + name: {{ include "aidbox.fullname" . }} {{- range .Values.extraEnvFromConfigMaps }} - configMapRef: name: {{ . }} diff --git a/aidbox/templates/secrets.yaml b/aidbox/templates/secrets.yaml index 114227e..06ac01a 100644 --- a/aidbox/templates/secrets.yaml +++ b/aidbox/templates/secrets.yaml @@ -1,4 +1,3 @@ -{{- if not .Values.auth.existingSecret -}} apiVersion: v1 kind: Secret metadata: @@ -18,4 +17,3 @@ data: {{ if .PGUSER }}PGUSER: {{ .PGUSER | b64enc }}{{ end }} {{ if .PGPASSWORD }}PGPASSWORD: {{ .PGPASSWORD | b64enc }}{{ end }} {{- end }} -{{- end -}} \ No newline at end of file diff --git a/aidbox/values.yaml b/aidbox/values.yaml index 3171483..ca045a1 100644 --- a/aidbox/values.yaml +++ b/aidbox/values.yaml @@ -10,9 +10,6 @@ config: BOX_METRICS_PORT: 8765 PGPORT: 5432 -auth: - existingSecret: "" - image: repository: healthsamurai/aidboxone pullPolicy: IfNotPresent diff --git a/aidboxdb/templates/_helpers.tpl b/aidboxdb/templates/_helpers.tpl index 8349e42..cd667f9 100644 --- a/aidboxdb/templates/_helpers.tpl +++ b/aidboxdb/templates/_helpers.tpl @@ -60,13 +60,3 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} - - -{{/* Create the secret name for AidboxDB, using existingSecret if set */}} -{{- define "aidboxdb.secretName" -}} -{{- if .Values.auth.existingSecret -}} -{{ .Values.auth.existingSecret }} -{{- else -}} -{{ include "aidboxdb.fullname" . }} -{{- end -}} -{{- end -}} diff --git a/aidboxdb/templates/secrets.yaml b/aidboxdb/templates/secrets.yaml index 995d9fd..2c7ca3b 100644 --- a/aidboxdb/templates/secrets.yaml +++ b/aidboxdb/templates/secrets.yaml @@ -1,4 +1,3 @@ -{{- if not .Values.auth.existingSecret -}} apiVersion: v1 kind: Secret metadata: @@ -11,4 +10,3 @@ data: POSTGRES_PASSWORD: {{ .POSTGRES_PASSWORD | b64enc }} POSTGRES_USER: {{ .POSTGRES_USER | b64enc }} {{- end }} -{{- end -}} \ No newline at end of file diff --git a/aidboxdb/templates/statefulset.yaml b/aidboxdb/templates/statefulset.yaml index 0480fb6..37857db 100644 --- a/aidboxdb/templates/statefulset.yaml +++ b/aidboxdb/templates/statefulset.yaml @@ -46,7 +46,11 @@ spec: - configMapRef: name: {{ $fullName }}-env - secretRef: - name: {{ include "aidboxdb.secretName" . }} + name: {{ $fullName }} + {{- range .Values.extraEnvFromSecrets }} + - secretRef: + name: {{ . }} + {{- end }} volumeMounts: - name: db-pg-config mountPath: /etc/configs diff --git a/aidboxdb/values.yaml b/aidboxdb/values.yaml index 728bbce..fdd8da4 100644 --- a/aidboxdb/values.yaml +++ b/aidboxdb/values.yaml @@ -10,9 +10,6 @@ env: POSTGRES_USER: postgres POSTGRES_DB: postgres -auth: - existingSecret: "" - storage: # -- Storage className to use className: "" @@ -50,6 +47,8 @@ securityContext: {} # runAsNonRoot: true # runAsUser: 1000 +extraEnvFromSecrets: [] + # -- Additional volumes volumes: [] # - name: foo