From 4f2dd36e33f8a4abb498147177630c193a8e7c00 Mon Sep 17 00:00:00 2001 From: Don Kendall Date: Tue, 5 Jul 2022 18:26:50 -0400 Subject: [PATCH] feat(helm): expose DATABASE_URL (#5445) --- dev/helm/templates/NOTES.txt | 2 +- dev/helm/templates/deployment.yaml | 5 +++++ dev/helm/values.yaml | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dev/helm/templates/NOTES.txt b/dev/helm/templates/NOTES.txt index 5199428e..93c0d356 100644 --- a/dev/helm/templates/NOTES.txt +++ b/dev/helm/templates/NOTES.txt @@ -2,7 +2,7 @@ {{- if .Values.ingress.enabled }} {{- range $host := .Values.ingress.hosts }} {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} {{- end }} {{- end }} {{- else if contains "NodePort" .Values.service.type }} diff --git a/dev/helm/templates/deployment.yaml b/dev/helm/templates/deployment.yaml index 24910f2b..63b3d768 100644 --- a/dev/helm/templates/deployment.yaml +++ b/dev/helm/templates/deployment.yaml @@ -41,6 +41,10 @@ spec: env: - name: DB_TYPE value: postgres + {{- if .Values.externalPostgresql.databaseURL }} + - name: DATABASE_URL + value: {{ .Values.externalPostgresql.databaseURL }} + {{- else }} - name: DB_HOST value: {{ template "wiki.postgresql.host" . }} - name: DB_PORT @@ -62,6 +66,7 @@ spec: name: {{ template "wiki.postgresql.secret" . }} {{- end }} key: {{ template "wiki.postgresql.secretKey" . }} + {{- end }} - name: HA_ACTIVE value: {{ .Values.replicaCount | int | le 2 | quote }} {{- with .Values.volumeMounts }} diff --git a/dev/helm/values.yaml b/dev/helm/values.yaml index 6b7296a7..ebe2260d 100644 --- a/dev/helm/values.yaml +++ b/dev/helm/values.yaml @@ -102,6 +102,10 @@ sideload: # - name: HTTPS_PROXY # value: http://my.proxy.com:3128 +## This will override the postgresql chart values +# externalPostgresql: +# databaseURL: postgresql://postgres:postgres@postgres:5432/wiki?sslmode=require + ## Configuration values for the postgresql dependency. ## ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md ##