From 7a4bc5c485d94bbc56ccd200cfe5d50b533c048d Mon Sep 17 00:00:00 2001 From: adityagajbhiye Date: Fri, 17 Mar 2023 21:00:20 +0530 Subject: [PATCH 01/13] postgres chart dependency fixed --- charts/dftbackend/templates/deployment.yaml | 5 +--- .../templates/postgresql-secrets.yaml | 9 ++++--- charts/dftbackend/values.yaml | 24 +++++++++++++------ 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/charts/dftbackend/templates/deployment.yaml b/charts/dftbackend/templates/deployment.yaml index 396e8115f..dc2ad394e 100644 --- a/charts/dftbackend/templates/deployment.yaml +++ b/charts/dftbackend/templates/deployment.yaml @@ -58,10 +58,7 @@ spec: - containerPort: {{ .Values.portContainer }} env: - name: SPRING_DATASOURCE_URL - valueFrom: - secretKeyRef: - name: dft-postgresql-secrets - key: dbUrl + value: "jdbc:postgresql://{{ .Values.dftpostgressql.fullnameOverride }}:{{ .Values.dftpostgresql.auth.port }}/{{ .Values.dftpostgresql.auth.database }}" - name: SPRING_DATASOURCE_USERNAME valueFrom: secretKeyRef: diff --git a/charts/dftbackend/templates/postgresql-secrets.yaml b/charts/dftbackend/templates/postgresql-secrets.yaml index c84e0d39e..feed1c694 100644 --- a/charts/dftbackend/templates/postgresql-secrets.yaml +++ b/charts/dftbackend/templates/postgresql-secrets.yaml @@ -4,8 +4,7 @@ metadata: name: dft-postgresql-secrets type: Opaque stringData: - dbUrl: "" - username: "" - password: "" - postgres-password: "" - database: "" \ No newline at end of file + username: {{ .Values.dftpostgresql.auth.username | default ( randAlphaNum 32 | quote ) }} + password: {{ .Values.dftpostgresql.auth.password | default ( randAlphaNum 32 | quote ) }} + postgresPassword: {{ .Values.dftpostgresql.auth.postgresPassword | default ( randAlphaNum 32 | quote ) }} + database: {{ .Values.dftpostgresql.auth.database | default ( randAlphaNum 32 | quote ) }} \ No newline at end of file diff --git a/charts/dftbackend/values.yaml b/charts/dftbackend/values.yaml index ec35674ca..0b1ce62e6 100644 --- a/charts/dftbackend/values.yaml +++ b/charts/dftbackend/values.yaml @@ -117,15 +117,25 @@ tolerations: [] affinity: {} -dftpostgresql: +dftpostgresql: + # -- PostgreSQL chart configuration + # Switch to enable or disable the PostgreSQL helm chart enabled: true + # -- FullnameOverride to 'dft-backend-postgresql'. + fullnameOverride: "dft-backend-postgresql" auth: - username: "dftUser" - database: "dftdb" - existingSecret: dft-postgresql-secrets - secretKeys: - adminPasswordKey: "postgres-password" - userPasswordKey: "password" + username: "dftuser" + + password: "" + # -- Database name + database: "postgres" + # -- Database port number + port: 5432 + # -- Secret containing the passwords for root usernames postgres and non-root usernames repl_user, portal and provisioning. + existingSecret: "dft-postgresql-secrets" + + postgresPassword: "" + configuration: properties: |- From 1f9fd105c9dfde11c45da75a5c02283be2ddb3c6 Mon Sep 17 00:00:00 2001 From: adityagajbhiye Date: Fri, 17 Mar 2023 21:29:19 +0530 Subject: [PATCH 02/13] config changes for postgres --- charts/dftbackend/templates/deployment.yaml | 2 +- charts/dftbackend/values.yaml | 23 ++++++++------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/charts/dftbackend/templates/deployment.yaml b/charts/dftbackend/templates/deployment.yaml index dc2ad394e..62a3e29ac 100644 --- a/charts/dftbackend/templates/deployment.yaml +++ b/charts/dftbackend/templates/deployment.yaml @@ -58,7 +58,7 @@ spec: - containerPort: {{ .Values.portContainer }} env: - name: SPRING_DATASOURCE_URL - value: "jdbc:postgresql://{{ .Values.dftpostgressql.fullnameOverride }}:{{ .Values.dftpostgresql.auth.port }}/{{ .Values.dftpostgresql.auth.database }}" + value: "jdbc:postgresql://{{ .Release.Name }}:{{ .Values.dftpostgresql.auth.port }}/{{ .Values.dftpostgresql.auth.database }}" - name: SPRING_DATASOURCE_USERNAME valueFrom: secretKeyRef: diff --git a/charts/dftbackend/values.yaml b/charts/dftbackend/values.yaml index 0b1ce62e6..80e9f75ec 100644 --- a/charts/dftbackend/values.yaml +++ b/charts/dftbackend/values.yaml @@ -121,21 +121,16 @@ dftpostgresql: # -- PostgreSQL chart configuration # Switch to enable or disable the PostgreSQL helm chart enabled: true - # -- FullnameOverride to 'dft-backend-postgresql'. - fullnameOverride: "dft-backend-postgresql" auth: - username: "dftuser" - - password: "" - # -- Database name - database: "postgres" - # -- Database port number - port: 5432 - # -- Secret containing the passwords for root usernames postgres and non-root usernames repl_user, portal and provisioning. - existingSecret: "dft-postgresql-secrets" - - postgresPassword: "" - + postgresPassword: "" + username: "dftuser" + password: "" + port: 5432 + database: "" + existingSecret: "dft-postgresql-secrets" + secretKeys: + adminPasswordKey: "postgresPassword" + userPasswordKey: "password" configuration: properties: |- From 186f2e644fefd564d25562aca81c9c067315a928 Mon Sep 17 00:00:00 2001 From: adityagajbhiye Date: Fri, 17 Mar 2023 21:39:10 +0530 Subject: [PATCH 03/13] fullname-over-ride --- charts/dftbackend/templates/deployment.yaml | 2 +- charts/dftbackend/values.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/dftbackend/templates/deployment.yaml b/charts/dftbackend/templates/deployment.yaml index 62a3e29ac..adf4516f2 100644 --- a/charts/dftbackend/templates/deployment.yaml +++ b/charts/dftbackend/templates/deployment.yaml @@ -58,7 +58,7 @@ spec: - containerPort: {{ .Values.portContainer }} env: - name: SPRING_DATASOURCE_URL - value: "jdbc:postgresql://{{ .Release.Name }}:{{ .Values.dftpostgresql.auth.port }}/{{ .Values.dftpostgresql.auth.database }}" + value: "jdbc:postgresql://{{ .Values.dftpostgresql.fullnameOverride }}:{{ .Values.dftpostgresql.auth.port }}/{{ .Values.dftpostgresql.auth.database }}" - name: SPRING_DATASOURCE_USERNAME valueFrom: secretKeyRef: diff --git a/charts/dftbackend/values.yaml b/charts/dftbackend/values.yaml index 80e9f75ec..362da8f51 100644 --- a/charts/dftbackend/values.yaml +++ b/charts/dftbackend/values.yaml @@ -121,6 +121,7 @@ dftpostgresql: # -- PostgreSQL chart configuration # Switch to enable or disable the PostgreSQL helm chart enabled: true + fullnameOverride: "product-dft-backend-postgres" auth: postgresPassword: "" username: "dftuser" From 815491ac367979d8729e40fff0a8d1fd61df437e Mon Sep 17 00:00:00 2001 From: adityagajbhiye Date: Fri, 17 Mar 2023 21:49:31 +0530 Subject: [PATCH 04/13] username emptied --- charts/dftbackend/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/dftbackend/values.yaml b/charts/dftbackend/values.yaml index 362da8f51..2c119f054 100644 --- a/charts/dftbackend/values.yaml +++ b/charts/dftbackend/values.yaml @@ -124,7 +124,7 @@ dftpostgresql: fullnameOverride: "product-dft-backend-postgres" auth: postgresPassword: "" - username: "dftuser" + username: "" password: "" port: 5432 database: "" From bbb119a4cd742465bcfeeadcf38af20c5fbca938 Mon Sep 17 00:00:00 2001 From: adityagajbhiye Date: Fri, 17 Mar 2023 21:56:09 +0530 Subject: [PATCH 05/13] removed existing secret --- charts/dftbackend/values.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/dftbackend/values.yaml b/charts/dftbackend/values.yaml index 2c119f054..fe23b6ff9 100644 --- a/charts/dftbackend/values.yaml +++ b/charts/dftbackend/values.yaml @@ -128,10 +128,10 @@ dftpostgresql: password: "" port: 5432 database: "" - existingSecret: "dft-postgresql-secrets" + existingSecret: "" secretKeys: - adminPasswordKey: "postgresPassword" - userPasswordKey: "password" + adminPasswordKey: "" + userPasswordKey: "" configuration: properties: |- From a189525102020f6011d01aabb0c796f9eea99f0e Mon Sep 17 00:00:00 2001 From: adityagajbhiye Date: Fri, 17 Mar 2023 22:01:22 +0530 Subject: [PATCH 06/13] update config --- charts/dftbackend/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/dftbackend/values.yaml b/charts/dftbackend/values.yaml index fe23b6ff9..0a53f0622 100644 --- a/charts/dftbackend/values.yaml +++ b/charts/dftbackend/values.yaml @@ -124,10 +124,10 @@ dftpostgresql: fullnameOverride: "product-dft-backend-postgres" auth: postgresPassword: "" - username: "" + username: "dftuser" password: "" port: 5432 - database: "" + database: "dftdb" existingSecret: "" secretKeys: adminPasswordKey: "" From c73a1ace22ba02ae0ed1b868f372ea0c001db6a1 Mon Sep 17 00:00:00 2001 From: adityagajbhiye Date: Fri, 17 Mar 2023 22:21:28 +0530 Subject: [PATCH 07/13] secrets for postgres --- charts/dftbackend/templates/postgresql-secrets.yaml | 4 +--- charts/dftbackend/values.yaml | 9 ++++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/charts/dftbackend/templates/postgresql-secrets.yaml b/charts/dftbackend/templates/postgresql-secrets.yaml index feed1c694..7ebebba06 100644 --- a/charts/dftbackend/templates/postgresql-secrets.yaml +++ b/charts/dftbackend/templates/postgresql-secrets.yaml @@ -4,7 +4,5 @@ metadata: name: dft-postgresql-secrets type: Opaque stringData: - username: {{ .Values.dftpostgresql.auth.username | default ( randAlphaNum 32 | quote ) }} password: {{ .Values.dftpostgresql.auth.password | default ( randAlphaNum 32 | quote ) }} - postgresPassword: {{ .Values.dftpostgresql.auth.postgresPassword | default ( randAlphaNum 32 | quote ) }} - database: {{ .Values.dftpostgresql.auth.database | default ( randAlphaNum 32 | quote ) }} \ No newline at end of file + postgresPassword: {{ .Values.dftpostgresql.auth.postgresPassword | default ( randAlphaNum 32 | quote ) }} \ No newline at end of file diff --git a/charts/dftbackend/values.yaml b/charts/dftbackend/values.yaml index 0a53f0622..f6fd14579 100644 --- a/charts/dftbackend/values.yaml +++ b/charts/dftbackend/values.yaml @@ -124,14 +124,13 @@ dftpostgresql: fullnameOverride: "product-dft-backend-postgres" auth: postgresPassword: "" - username: "dftuser" - password: "" port: 5432 database: "dftdb" - existingSecret: "" + existingSecret: "dft-postgresql-secrets" secretKeys: - adminPasswordKey: "" - userPasswordKey: "" + username: "dftuser" + adminPasswordKey: "postgresPassword" + userPasswordKey: "password" configuration: properties: |- From 838b872ad4eec5e783f187d2a0f3aec319a760d2 Mon Sep 17 00:00:00 2001 From: adityagajbhiye Date: Fri, 17 Mar 2023 22:30:36 +0530 Subject: [PATCH 08/13] postgres config update --- charts/dftbackend/templates/postgresql-secrets.yaml | 1 + charts/dftbackend/values.yaml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/dftbackend/templates/postgresql-secrets.yaml b/charts/dftbackend/templates/postgresql-secrets.yaml index 7ebebba06..bdaed5712 100644 --- a/charts/dftbackend/templates/postgresql-secrets.yaml +++ b/charts/dftbackend/templates/postgresql-secrets.yaml @@ -4,5 +4,6 @@ metadata: name: dft-postgresql-secrets type: Opaque stringData: + username: {{ .Values.dftpostgresql.auth.username | default ( dftuser | quote ) }} password: {{ .Values.dftpostgresql.auth.password | default ( randAlphaNum 32 | quote ) }} postgresPassword: {{ .Values.dftpostgresql.auth.postgresPassword | default ( randAlphaNum 32 | quote ) }} \ No newline at end of file diff --git a/charts/dftbackend/values.yaml b/charts/dftbackend/values.yaml index f6fd14579..13ec49911 100644 --- a/charts/dftbackend/values.yaml +++ b/charts/dftbackend/values.yaml @@ -124,11 +124,12 @@ dftpostgresql: fullnameOverride: "product-dft-backend-postgres" auth: postgresPassword: "" + username: "" + password: "" port: 5432 database: "dftdb" existingSecret: "dft-postgresql-secrets" secretKeys: - username: "dftuser" adminPasswordKey: "postgresPassword" userPasswordKey: "password" From 56c2a312ce4a1f162b3fd23b45b4e9ce72edbc27 Mon Sep 17 00:00:00 2001 From: adityagajbhiye Date: Fri, 17 Mar 2023 22:32:46 +0530 Subject: [PATCH 09/13] quote update --- charts/dftbackend/templates/postgresql-secrets.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/dftbackend/templates/postgresql-secrets.yaml b/charts/dftbackend/templates/postgresql-secrets.yaml index bdaed5712..6a0f783d5 100644 --- a/charts/dftbackend/templates/postgresql-secrets.yaml +++ b/charts/dftbackend/templates/postgresql-secrets.yaml @@ -4,6 +4,6 @@ metadata: name: dft-postgresql-secrets type: Opaque stringData: - username: {{ .Values.dftpostgresql.auth.username | default ( dftuser | quote ) }} + username: {{ .Values.dftpostgresql.auth.username | default ( "dftuser" ) }} password: {{ .Values.dftpostgresql.auth.password | default ( randAlphaNum 32 | quote ) }} postgresPassword: {{ .Values.dftpostgresql.auth.postgresPassword | default ( randAlphaNum 32 | quote ) }} \ No newline at end of file From 384a27a67a974fbe7d8e8240f05d2ddd43a0764b Mon Sep 17 00:00:00 2001 From: adityagajbhiye Date: Fri, 17 Mar 2023 22:52:37 +0530 Subject: [PATCH 10/13] update config for db --- charts/dftbackend/templates/deployment.yaml | 5 +---- charts/dftbackend/templates/postgresql-secrets.yaml | 5 ++--- charts/dftbackend/values.yaml | 6 ++---- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/charts/dftbackend/templates/deployment.yaml b/charts/dftbackend/templates/deployment.yaml index adf4516f2..64024ffa5 100644 --- a/charts/dftbackend/templates/deployment.yaml +++ b/charts/dftbackend/templates/deployment.yaml @@ -60,10 +60,7 @@ spec: - name: SPRING_DATASOURCE_URL 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 6a0f783d5..773feae83 100644 --- a/charts/dftbackend/templates/postgresql-secrets.yaml +++ b/charts/dftbackend/templates/postgresql-secrets.yaml @@ -4,6 +4,5 @@ metadata: name: dft-postgresql-secrets type: Opaque stringData: - username: {{ .Values.dftpostgresql.auth.username | default ( "dftuser" ) }} - password: {{ .Values.dftpostgresql.auth.password | default ( randAlphaNum 32 | quote ) }} - postgresPassword: {{ .Values.dftpostgresql.auth.postgresPassword | default ( randAlphaNum 32 | quote ) }} \ No newline at end of file + password: {{ .Values.dftpostgresql.auth.secretKeys.password | default ( randAlphaNum 32 | quote ) }} + postgres-password: {{ .Values.dftpostgresql.auth.secretKeys.postgres-password | default ( randAlphaNum 32 | quote ) }} \ No newline at end of file diff --git a/charts/dftbackend/values.yaml b/charts/dftbackend/values.yaml index 13ec49911..2adbed708 100644 --- a/charts/dftbackend/values.yaml +++ b/charts/dftbackend/values.yaml @@ -123,14 +123,12 @@ dftpostgresql: enabled: true fullnameOverride: "product-dft-backend-postgres" auth: - postgresPassword: "" - username: "" - password: "" + username: "dftuser" port: 5432 database: "dftdb" existingSecret: "dft-postgresql-secrets" secretKeys: - adminPasswordKey: "postgresPassword" + adminPasswordKey: "postgres-password" userPasswordKey: "password" configuration: From 9b65f2b41f9dd888bd6d78d1f76a5113af26e869 Mon Sep 17 00:00:00 2001 From: adityagajbhiye Date: Fri, 17 Mar 2023 23:02:06 +0530 Subject: [PATCH 11/13] update password random --- charts/dftbackend/templates/postgresql-secrets.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/dftbackend/templates/postgresql-secrets.yaml b/charts/dftbackend/templates/postgresql-secrets.yaml index 773feae83..3cf460829 100644 --- a/charts/dftbackend/templates/postgresql-secrets.yaml +++ b/charts/dftbackend/templates/postgresql-secrets.yaml @@ -5,4 +5,4 @@ metadata: type: Opaque stringData: password: {{ .Values.dftpostgresql.auth.secretKeys.password | default ( randAlphaNum 32 | quote ) }} - postgres-password: {{ .Values.dftpostgresql.auth.secretKeys.postgres-password | default ( randAlphaNum 32 | quote ) }} \ No newline at end of file + postgres-password: {{ .Values.dftpostgresql.auth.secretKeys.password | default ( randAlphaNum 32 | quote ) }} \ No newline at end of file From e48a6ae41e02c4e463d8585aa11aff06668c45d7 Mon Sep 17 00:00:00 2001 From: adityagajbhiye Date: Fri, 17 Mar 2023 23:13:00 +0530 Subject: [PATCH 12/13] 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: |- From ea620c19309cffa05d24b13b0c18a97678f51d45 Mon Sep 17 00:00:00 2001 From: adityagajbhiye Date: Mon, 20 Mar 2023 12:55:44 +0530 Subject: [PATCH 13/13] Key values change in secret --- charts/dftbackend/templates/postgresql-secrets.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/dftbackend/templates/postgresql-secrets.yaml b/charts/dftbackend/templates/postgresql-secrets.yaml index 3cf460829..58c752a29 100644 --- a/charts/dftbackend/templates/postgresql-secrets.yaml +++ b/charts/dftbackend/templates/postgresql-secrets.yaml @@ -4,5 +4,5 @@ metadata: name: dft-postgresql-secrets type: Opaque stringData: - 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 + password: {{ .Values.dftpostgresql.auth.secretKeys.adminPasswordKey | default ( randAlphaNum 32 | quote ) }} + postgres-password: {{ .Values.dftpostgresql.auth.secretKeys.userPasswordKey | default ( randAlphaNum 32 | quote ) }} \ No newline at end of file