J release changes
[ric-plt/ric-dep.git] / helm / infrastructure / subcharts / kong / charts / postgresql / templates / secrets.yaml
1 {{- if (include "postgresql.createSecret" .) }}
2 apiVersion: v1
3 kind: Secret
4 metadata:
5   name: {{ include "common.names.fullname" . }}
6   namespace: {{ .Release.Namespace | quote }}
7   labels: {{- include "common.labels.standard" . | nindent 4 }}
8     {{- if .Values.commonLabels }}
9     {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
10     {{- end }}
11   {{- if .Values.commonAnnotations }}
12   annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
13   {{- end }}
14 type: Opaque
15 data:
16   {{- if .Values.auth.enablePostgresUser }}
17   postgres-password: {{ include "common.secrets.passwords.manage" (dict "secret" (include "common.names.fullname" .) "key" "postgres-password" "providedValues" (list "global.postgresql.auth.postgresPassword" "auth.postgresPassword") "context" $) }}
18   {{- end }}
19   {{- if not (empty (include "postgresql.username" .)) }}
20   password: {{ include "common.secrets.passwords.manage" (dict "secret" (include "common.names.fullname" .) "key" "password" "providedValues" (list "global.postgresql.auth.password" "auth.password") "context" $) }}
21   {{- end }}
22   {{- if eq .Values.architecture "replication" }}
23   replication-password: {{ include "common.secrets.passwords.manage" (dict "secret" (include "common.names.fullname" .) "key" "replication-password" "providedValues" (list "auth.replicationPassword") "context" $) }}
24   {{- end }}
25   # We don't auto-generate LDAP password when it's not provided as we do for other passwords
26   {{- if and .Values.ldap.enabled (or .Values.ldap.bind_password .Values.ldap.bindpw) }}
27   ldap-password: {{ coalesce .Values.ldap.bind_password .Values.ldap.bindpw  | b64enc | quote }}
28   {{- end }}
29 {{- end -}}