@@ -2,48 +2,50 @@ credential:
22 - name : HOST
33 valueFrom :
44 serviceRef :
5- name : {{ template "postgresql.fullname" . }}
5+ name : {{ template "postgresql.primary. fullname" . }}
66 jsonpath : ' { .status.loadBalancer.ingress[*].ip }'
77
88 - name : PORT
9- valueFrom :
9+ valueFrom :
1010 serviceRef :
11- name : {{ template "postgresql.fullname" . }}
11+ name : {{ template "postgresql.primary. fullname" . }}
1212 jsonpath : ' { .spec.ports[?(@.name=="tcp-postgresql")].port }'
1313
14+ {{- if not (empty (include "postgresql.username" .)) }}
1415 - name : USERNAME
15- value : {{ .Values.postgresqlUsername }}
16+ value : {{ template "postgresql.username" . }}
17+ {{- end }}
1618
1719 - name : PASSWORD
1820 valueFrom :
1921 secretKeyRef :
20- name : {{ template "postgresql.fullname" . }}
21- jsonpath : ' { .data.postgresql-password }'
22+ name : {{ template "common.names.fullname" . }}
23+ jsonpath : ' { .data.postgres-password }'
24+
25+ {{- if (include "postgresql.database" .) }}
26+ - name : DATABASE
27+ value : {{ template "postgresql.database" . }}
28+ {{- end }}
2229
23- {{- if .Values.replication.enabled }}
30+ {{- if eq .Values.architecture " replication" }}
2431 - name : READHOST
2532 valueFrom :
2633 serviceRef :
27- name : {{ template "postgresql.fullname" . }}-read
34+ name : {{ template "postgresql.readReplica. fullname" . }}
2835 jsonpath : ' { .status.loadBalancer.ingress[*].ip }'
2936
3037 - name : READPORT
3138 valueFrom :
3239 serviceRef :
33- name : {{ template "postgresql.fullname" . }}-read
40+ name : {{ template "postgresql.readReplica. fullname" . }}
3441 jsonpath : ' { .spec.ports[?(@.name=="tcp-postgresql")].port }'
3542
3643 - name : REPLICATIONUSERNAME
37- value : {{ template "postgresql.replication.username" . }}
44+ value : {{ .Values.auth.replicationUsername }}
3845
3946 - name : REPLICATIONPASSWORD
4047 valueFrom :
4148 secretKeyRef :
42- name : {{ template "postgresql.fullname" . }}
43- jsonpath : ' { .data.postgresql-replication-password }'
44- {{- end }}
45-
46- {{- if .Values.postgresqlDatabase }}
47- - name : DATABASE
48- value : {{ .Values.postgresqlDatabase }}
49+ name : {{ template "common.names.fullname" . }}
50+ jsonpath : ' { .data.replication-password }'
4951 {{- end }}
0 commit comments