Browse Source

feat(helm): expose DATABASE_URL (#5445)

Don Kendall 3 years ago
parent
commit
4f2dd36e33
3 changed files with 10 additions and 1 deletions
  1. 1 1
      dev/helm/templates/NOTES.txt
  2. 5 0
      dev/helm/templates/deployment.yaml
  3. 4 0
      dev/helm/values.yaml

+ 1 - 1
dev/helm/templates/NOTES.txt

@@ -2,7 +2,7 @@
 {{- if .Values.ingress.enabled }}
 {{- if .Values.ingress.enabled }}
 {{- range $host := .Values.ingress.hosts }}
 {{- range $host := .Values.ingress.hosts }}
   {{- range .paths }}
   {{- range .paths }}
-  http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
+  http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
   {{- end }}
   {{- end }}
 {{- end }}
 {{- end }}
 {{- else if contains "NodePort" .Values.service.type }}
 {{- else if contains "NodePort" .Values.service.type }}

+ 5 - 0
dev/helm/templates/deployment.yaml

@@ -41,6 +41,10 @@ spec:
           env:
           env:
             - name: DB_TYPE
             - name: DB_TYPE
               value: postgres
               value: postgres
+            {{- if .Values.externalPostgresql.databaseURL }}
+            - name: DATABASE_URL
+              value: {{ .Values.externalPostgresql.databaseURL }}
+            {{- else }}
             - name: DB_HOST
             - name: DB_HOST
               value: {{ template "wiki.postgresql.host" . }}
               value: {{ template "wiki.postgresql.host" . }}
             - name: DB_PORT
             - name: DB_PORT
@@ -62,6 +66,7 @@ spec:
                   name: {{ template "wiki.postgresql.secret" . }}
                   name: {{ template "wiki.postgresql.secret" . }}
                 {{- end }}
                 {{- end }}
                   key: {{ template "wiki.postgresql.secretKey" . }}
                   key: {{ template "wiki.postgresql.secretKey" . }}
+            {{- end }}
             - name: HA_ACTIVE
             - name: HA_ACTIVE
               value: {{ .Values.replicaCount | int | le 2 | quote }}
               value: {{ .Values.replicaCount | int | le 2 | quote }}
     {{- with .Values.volumeMounts }}
     {{- with .Values.volumeMounts }}

+ 4 - 0
dev/helm/values.yaml

@@ -102,6 +102,10 @@ sideload:
   #  - name: HTTPS_PROXY
   #  - name: HTTPS_PROXY
   #    value: http://my.proxy.com:3128
   #    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.
 ## Configuration values for the postgresql dependency.
 ## ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md
 ## ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md
 ##
 ##