1 apiVersion: extensions/v1beta1
4 name: {{ template "postgresql.fullname" . }}
5 namespace: {{ .Values.global.nsPrefix }}
7 app: {{ template "postgresql.fullname" . }}
8 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
9 release: "{{ .Release.Name }}"
10 heritage: "{{ .Release.Service }}"
15 app: {{ template "postgresql.fullname" . }}
17 {{- if .Values.affinity }}
19 {{ toYaml .Values.affinity | indent 8 }}
21 {{- if .Values.nodeSelector }}
23 {{ toYaml .Values.nodeSelector | indent 8 }}
25 {{- if .Values.tolerations }}
27 {{ toYaml .Values.tolerations | indent 8 }}
29 {{- if .Values.schedulerName }}
30 schedulerName: "{{ .Values.schedulerName }}"
33 - name: {{ template "postgresql.fullname" . }}
34 image: "{{ .Values.image }}:{{ .Values.imageTag }}"
35 imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
37 {{- range $key, $value := default dict .Values.postgresConfig }}
39 - '{{ $key | snakecase }}={{ $value }}'
43 value: {{ default "postgres" .Values.global.postgresUser | quote }}
44 # Required for pg_isready in the health probes.
46 value: {{ default "postgres" .Values.global.postgresUser | quote }}
48 value: {{ default "" .Values.global.postgresDatabase | quote }}
49 - name: POSTGRES_INITDB_ARGS
50 value: {{ default "" .Values.postgresInitdbArgs | quote }}
52 value: /var/lib/postgresql/data/pgdata
53 - name: POSTGRES_PASSWORD
54 value: {{ default "postgres" .Values.global.postgresPassword | quote }}
58 # name: {{ template "postgresql.fullname" . }}
59 # key: postgres-password
61 valueFrom: { fieldRef: { fieldPath: status.podIP } }
70 - exec pg_isready --host $POD_IP
71 initialDelaySeconds: 120
79 - exec pg_isready --host $POD_IP
80 initialDelaySeconds: 5
84 {{ toYaml .Values.resources | indent 10 }}
87 mountPath: {{ .Values.persistence.mountPath }}
88 subPath: {{ .Values.persistence.subPath }}
89 {{- if .Values.metrics.enabled }}
91 image: "{{ .Values.metrics.image }}:{{ .Values.metrics.imageTag }}"
92 imagePullPolicy: {{ default "" .Values.metrics.imagePullPolicy | quote }}
94 - name: DATA_SOURCE_NAME
95 value: postgresql://postgres@127.0.0.1:5432?sslmode=disable
99 {{- if .Values.metrics.customMetrics }}
100 args: ["-extend.query-path", "/conf/custom-metrics.yaml"]
102 - name: custom-metrics
107 {{ toYaml .Values.metrics.resources | indent 10 }}
111 {{- if .Values.persistence.enabled }}
112 persistentVolumeClaim:
113 claimName: {{ .Values.persistence.existingClaim | default (include "postgresql.fullname" .) }}
117 {{- if and .Values.metrics.enabled .Values.metrics.customMetrics }}
118 - name: custom-metrics
120 secretName: {{ template "postgresql.fullname" . }}
122 - key: custom-metrics.yaml
123 path: custom-metrics.yaml
125 {{- if .Values.imagePullSecrets }}
127 - name: {{ .Values.imagePullSecrets }}