From 82d72669e21a505d59a720811cc2f629e4a4b049 Mon Sep 17 00:00:00 2001 From: hadams95 Date: Mon, 18 Mar 2024 16:02:00 -0400 Subject: [PATCH] specific service dbcreds for dbcreate --- helm/common/templates/_db_setup_job.tpl | 28 +++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/helm/common/templates/_db_setup_job.tpl b/helm/common/templates/_db_setup_job.tpl index 9ea67dbe..c0bf9c45 100644 --- a/helm/common/templates/_db_setup_job.tpl +++ b/helm/common/templates/_db_setup_job.tpl @@ -59,6 +59,12 @@ spec: name: {{ .Release.Name }}-postgresql key: postgres-password optional: false + {{- else if .Values.postgres.externalSecret }} + valueFrom: + secretKeyRef: + name: {{ .Values.postgres.externalSecret }} + key: password + optional: false {{- else if $.Values.global.postgres.externalSecret }} valueFrom: secretKeyRef: @@ -69,7 +75,13 @@ spec: value: {{ .Values.global.postgres.master.password | quote}} {{- end }} - name: PGUSER - {{- if $.Values.global.postgres.externalSecret }} + {{- if .Values.postgres.externalSecret }} + valueFrom: + secretKeyRef: + name: {{ .Values.postgres.externalSecret }} + key: username + optional: false + {{- else if $.Values.global.postgres.externalSecret }} valueFrom: secretKeyRef: name: {{ $.Values.global.postgres.externalSecret }} @@ -79,7 +91,13 @@ spec: value: {{ .Values.global.postgres.master.username | quote }} {{- end }} - name: PGPORT - {{- if $.Values.global.postgres.externalSecret }} + {{- if .Values.postgres.externalSecret }} + valueFrom: + secretKeyRef: + name: {{ .Values.postgres.externalSecret }} + key: port + optional: false + {{- else if $.Values.global.postgres.externalSecret }} valueFrom: secretKeyRef: name: {{ $.Values.global.postgres.externalSecret }} @@ -91,6 +109,12 @@ spec: - name: PGHOST {{- if $.Values.global.dev }} value: "{{ .Release.Name }}-postgresql" + {{- else if .Values.postgres.externalSecret }} + valueFrom: + secretKeyRef: + name: {{ .Values.postgres.externalSecret }} + key: host + optional: false {{- else if $.Values.global.postgres.externalSecret }} valueFrom: secretKeyRef: