From 47ee661e81837c8906398abbee38a9f493afbecc Mon Sep 17 00:00:00 2001 From: Laurent CHASTEL <44160341+lchastel@users.noreply.github.com> Date: Mon, 11 Aug 2025 16:48:14 +0000 Subject: [PATCH 1/2] Set database hostname to 127.0.0.1 by default --- helm/defectdojo/templates/_helpers.tpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/helm/defectdojo/templates/_helpers.tpl b/helm/defectdojo/templates/_helpers.tpl index e709d3c5a30..311088de423 100644 --- a/helm/defectdojo/templates/_helpers.tpl +++ b/helm/defectdojo/templates/_helpers.tpl @@ -47,13 +47,13 @@ Create the name of the service account to use */}} {{- define "postgresql.hostname" -}} {{- if .Values.postgresql.enabled -}} -{{- if eq .Values.postgresql.architecture "replication" -}} -{{- printf "%s-%s-%s" .Release.Name "postgresql" .Values.postgresql.primary.name | trunc 63 | trimSuffix "-" -}} +{{- if eq .Values.postgresql.architecture "replication" -}} +{{- printf "%s-%s-%s" .Release.Name "postgresql" .Values.postgresql.primary.name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 | trimSuffix "-" -}} +{{- end -}} {{- else -}} -{{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- else -}} -{{- printf "%s" .Values.postgresql.postgresServer -}} +{{- printf "%s" ( .Values.postgresql.postgresServer | default "127.0.0.1" ) -}} {{- end -}} {{- end -}} {{- define "redis.hostname" -}} From 0e39f2274c1c839ab05b43ad22e57e3bc6ae9bc9 Mon Sep 17 00:00:00 2001 From: Laurent CHASTEL <44160341+lchastel@users.noreply.github.com> Date: Mon, 11 Aug 2025 16:48:57 +0000 Subject: [PATCH 2/2] Move and update comment about external instance in postgresql to ease the usage --- helm/defectdojo/values.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/helm/defectdojo/values.yaml b/helm/defectdojo/values.yaml index 0b23531a2c8..cb5aa46c262 100644 --- a/helm/defectdojo/values.yaml +++ b/helm/defectdojo/values.yaml @@ -405,6 +405,9 @@ initializer: staticName: false postgresql: + # To use an external PostgreSQL instance (like CloudSQL), set enabled to false, set items in auth part for authentication, + # and uncomment the line below: + # postgresServer: "127.0.0.1" enabled: true auth: username: defectdojo @@ -444,10 +447,6 @@ postgresql: chmod: enabled: false - # To use an external PostgreSQL instance, set enabled to false and uncomment - # the line below: - # postgresServer: "127.0.0.1" - # Google CloudSQL support in GKE via gce-proxy cloudsql: # To use CloudSQL in GKE set 'enable: true'