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" -}} 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'