From e48a6ae41e02c4e463d8585aa11aff06668c45d7 Mon Sep 17 00:00:00 2001 From: adityagajbhiye Date: Fri, 17 Mar 2023 23:13:00 +0530 Subject: [PATCH] Postgres update dependency --- charts/dftbackend/templates/deployment.yaml | 10 ++-------- .../templates/postgresql-secrets.yaml | 7 ++----- charts/dftbackend/values.yaml | 18 +++++++++++------- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/charts/dftbackend/templates/deployment.yaml b/charts/dftbackend/templates/deployment.yaml index 396e8115f..64024ffa5 100644 --- a/charts/dftbackend/templates/deployment.yaml +++ b/charts/dftbackend/templates/deployment.yaml @@ -58,15 +58,9 @@ spec: - containerPort: {{ .Values.portContainer }} env: - name: SPRING_DATASOURCE_URL - valueFrom: - secretKeyRef: - name: dft-postgresql-secrets - key: dbUrl + value: "jdbc:postgresql://{{ .Values.dftpostgresql.fullnameOverride }}:{{ .Values.dftpostgresql.auth.port }}/{{ .Values.dftpostgresql.auth.database }}" - name: SPRING_DATASOURCE_USERNAME - valueFrom: - secretKeyRef: - name: dft-postgresql-secrets - key: username + value: {{ .Values.dftpostgresql.auth.username }} - name: SPRING_DATASOURCE_PASSWORD valueFrom: secretKeyRef: diff --git a/charts/dftbackend/templates/postgresql-secrets.yaml b/charts/dftbackend/templates/postgresql-secrets.yaml index c84e0d39e..3cf460829 100644 --- a/charts/dftbackend/templates/postgresql-secrets.yaml +++ b/charts/dftbackend/templates/postgresql-secrets.yaml @@ -4,8 +4,5 @@ metadata: name: dft-postgresql-secrets type: Opaque stringData: - dbUrl: "" - username: "" - password: "" - postgres-password: "" - database: "" \ No newline at end of file + password: {{ .Values.dftpostgresql.auth.secretKeys.password | default ( randAlphaNum 32 | quote ) }} + postgres-password: {{ .Values.dftpostgresql.auth.secretKeys.password | default ( randAlphaNum 32 | quote ) }} \ No newline at end of file diff --git a/charts/dftbackend/values.yaml b/charts/dftbackend/values.yaml index ec35674ca..2adbed708 100644 --- a/charts/dftbackend/values.yaml +++ b/charts/dftbackend/values.yaml @@ -117,15 +117,19 @@ tolerations: [] affinity: {} -dftpostgresql: +dftpostgresql: + # -- PostgreSQL chart configuration + # Switch to enable or disable the PostgreSQL helm chart enabled: true + fullnameOverride: "product-dft-backend-postgres" auth: - username: "dftUser" - database: "dftdb" - existingSecret: dft-postgresql-secrets - secretKeys: - adminPasswordKey: "postgres-password" - userPasswordKey: "password" + username: "dftuser" + port: 5432 + database: "dftdb" + existingSecret: "dft-postgresql-secrets" + secretKeys: + adminPasswordKey: "postgres-password" + userPasswordKey: "password" configuration: properties: |-