Verified Commit 636b5b6f authored by Hugo's avatar Hugo
Browse files

more pg parameters

parent 07e58abc
......@@ -30,12 +30,12 @@ spec:
valueFrom:
secretKeyRef:
key: username
name: "hedgedoc.pg-{{ .Release.Namespace }}{{ .Values.pgCredentialsSuffix }}"
name: "hedgedoc.{{ tpl .Values.pg.name . }}{{ .Values.pg.credentialsSuffix }}"
- name: PGPASSWORD
valueFrom:
secretKeyRef:
key: password
name: "hedgedoc.pg-{{ .Release.Namespace }}{{ .Values.pgCredentialsSuffix }}"
name: "hedgedoc.{{ tpl .Values.pg.name . }}{{ .Values.pg.credentialsSuffix }}"
restartPolicy: Never
backoffLimit: 3
ttlSecondsAfterFinished: 120
......
{{ $secret := lookup "v1" "Secret" .Release.Namespace (include "secretName" .) }}
{{ $pgSecretName := print "hedgedoc.pg-" .Release.Namespace .Values.pgCredentialsSuffix }}
{{ $pgSecretName := print "hedgedoc." .Values.pg.name .Values.pg.credentialsSuffix }}
{{ $pgSecret := lookup "v1" "Secret" .Release.Namespace $pgSecretName }}
apiVersion: v1
kind: Secret
......@@ -10,9 +10,9 @@ metadata:
type: Opaque
stringData:
{{- if $pgSecret.data }}
CMD_DB_URL: postgres://{{ $pgSecret.data.username | b64dec }}:{{ $pgSecret.data.password | b64dec }}@pg-{{ .Release.Namespace }}:5432/hedgedoc
CMD_DB_URL: postgres://{{ $pgSecret.data.username | b64dec }}:{{ $pgSecret.data.password | b64dec }}@{{ tpl .Values.pg.name . }}:5432/hedgedoc
{{ else }}
CMD_DB_URL: postgres://unknown:unknown@pg-{{ .Release.Namespace }}:5432/hedgedoc
CMD_DB_URL: postgres://unknown:unknown@{{ tpl .Values.pg.name . }}:5432/hedgedoc
{{- end }}
{{- if $secret.data }}
CMD_SESSION_SECRET: {{ ($secret.data.CMD_SESSION_SECRET | default "" | b64dec) | default (randAlphaNum 64) }}
......
......@@ -19,5 +19,8 @@ oauth:
displayName: name
email: email
pgCredentialsSuffix: ".credentials"
pg:
name: "pg-{{ .Release.Namespace }}"
credentialsSuffix: ".credentials"
autoMigrateDomain: true
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment