1 {{- if eq .Values.architecture "replication" }}
2 {{- $customUser := include "postgresql.username" . }}
3 apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
6 name: {{ include "postgresql.readReplica.fullname" . }}
7 namespace: {{ .Release.Namespace | quote }}
8 labels: {{- include "common.labels.standard" . | nindent 4 }}
9 app.kubernetes.io/component: read
10 {{- if .Values.commonLabels }}
11 {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
13 {{- if .Values.readReplicas.labels }}
14 {{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.labels "context" $ ) | nindent 4 }}
17 {{- if .Values.commonAnnotations }}
18 {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
20 {{- if .Values.readReplicas.annotations }}
21 {{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.annotations "context" $ ) | nindent 4 }}
24 replicas: {{ .Values.readReplicas.replicaCount }}
25 serviceName: {{ include "postgresql.readReplica.svc.headless" . }}
26 {{- if .Values.readReplicas.updateStrategy }}
27 updateStrategy: {{- toYaml .Values.readReplicas.updateStrategy | nindent 4 }}
30 matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
31 app.kubernetes.io/component: read
34 name: {{ include "postgresql.readReplica.fullname" . }}
35 labels: {{- include "common.labels.standard" . | nindent 8 }}
36 app.kubernetes.io/component: read
37 {{- if .Values.commonLabels }}
38 {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }}
40 {{- if .Values.readReplicas.podLabels }}
41 {{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.podLabels "context" $ ) | nindent 8 }}
44 {{- if (include "postgresql.readReplicas.createExtendedConfigmap" .) }}
45 checksum/extended-configuration: {{ include (print $.Template.BasePath "/read/extended-configmap.yaml") . | sha256sum }}
47 {{- if .Values.readReplicas.podAnnotations }}
48 {{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.podAnnotations "context" $ ) | nindent 8 }}
51 {{- if .Values.readReplicas.extraPodSpec }}
52 {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.extraPodSpec "context" $) | nindent 6 }}
54 serviceAccountName: {{ include "postgresql.serviceAccountName" . }}
55 {{- include "postgresql.imagePullSecrets" . | nindent 6 }}
56 {{- if .Values.readReplicas.hostAliases }}
57 hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.hostAliases "context" $) | nindent 8 }}
59 {{- if .Values.readReplicas.affinity }}
60 affinity: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.affinity "context" $) | nindent 8 }}
63 podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.readReplicas.podAffinityPreset "component" "read" "context" $) | nindent 10 }}
64 podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.readReplicas.podAntiAffinityPreset "component" "read" "context" $) | nindent 10 }}
65 nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.readReplicas.nodeAffinityPreset.type "key" .Values.readReplicas.nodeAffinityPreset.key "values" .Values.readReplicas.nodeAffinityPreset.values) | nindent 10 }}
67 {{- if .Values.readReplicas.nodeSelector }}
68 nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.nodeSelector "context" $) | nindent 8 }}
70 {{- if .Values.readReplicas.tolerations }}
71 tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.tolerations "context" $) | nindent 8 }}
73 {{- if .Values.readReplicas.topologySpreadConstraints }}
74 topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.topologySpreadConstraints "context" $) | nindent 8 }}
76 {{- if .Values.readReplicas.priorityClassName }}
77 priorityClassName: {{ .Values.readReplicas.priorityClassName }}
79 {{- if .Values.readReplicas.schedulerName }}
80 schedulerName: {{ .Values.readReplicas.schedulerName | quote }}
82 {{- if .Values.readReplicas.terminationGracePeriodSeconds }}
83 terminationGracePeriodSeconds: {{ .Values.readReplicas.terminationGracePeriodSeconds }}
85 {{- if .Values.readReplicas.podSecurityContext.enabled }}
86 securityContext: {{- omit .Values.readReplicas.podSecurityContext "enabled" | toYaml | nindent 8 }}
88 hostNetwork: {{ .Values.readReplicas.hostNetwork }}
89 hostIPC: {{ .Values.readReplicas.hostIPC }}
91 {{- if and .Values.tls.enabled (not .Values.volumePermissions.enabled) }}
93 image: {{ include "postgresql.volumePermissions.image" . }}
94 imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
95 {{- if .Values.readReplicas.resources }}
96 resources: {{- toYaml .Values.readReplicas.resources | nindent 12 }}
98 # We don't require a privileged container in this case
99 {{- if .Values.readReplicas.containerSecurityContext.enabled }}
100 securityContext: {{- omit .Values.readReplicas.containerSecurityContext "enabled" | toYaml | nindent 12 }}
106 cp /tmp/certs/* /opt/bitnami/postgresql/certs/
107 chmod 600 {{ include "postgresql.tlsCertKey" . }}
109 - name: raw-certificates
110 mountPath: /tmp/certs
111 - name: postgresql-certificates
112 mountPath: /opt/bitnami/postgresql/certs
113 {{- else if and .Values.volumePermissions.enabled (or .Values.readReplicas.persistence.enabled .Values.shmVolume.enabled) }}
114 - name: init-chmod-data
115 image: {{ include "postgresql.volumePermissions.image" . }}
116 imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
117 {{- if .Values.readReplicas.resources }}
118 resources: {{- toYaml .Values.readReplicas.resources | nindent 12 }}
124 {{- if .Values.readReplicas.persistence.enabled }}
125 {{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
126 chown `id -u`:`id -G | cut -d " " -f2` {{ .Values.readReplicas.persistence.mountPath }}
128 chown {{ .Values.readReplicas.containerSecurityContext.runAsUser }}:{{ .Values.readReplicas.podSecurityContext.fsGroup }} {{ .Values.readReplicas.persistence.mountPath }}
130 mkdir -p {{ .Values.readReplicas.persistence.mountPath }}/data {{- if (include "postgresql.mountConfigurationCM" .) }} {{ .Values.readReplicas.persistence.mountPath }}/conf {{- end }}
131 chmod 700 {{ .Values.readReplicas.persistence.mountPath }}/data {{- if (include "postgresql.mountConfigurationCM" .) }} {{ .Values.readReplicas.persistence.mountPath }}/conf {{- end }}
132 find {{ .Values.readReplicas.persistence.mountPath }} -mindepth 1 -maxdepth 1 {{- if not (include "postgresql.mountConfigurationCM" .) }} -not -name "conf" {{- end }} -not -name ".snapshot" -not -name "lost+found" | \
133 {{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
134 xargs -r chown -R `id -u`:`id -G | cut -d " " -f2`
136 xargs -r chown -R {{ .Values.readReplicas.containerSecurityContext.runAsUser }}:{{ .Values.readReplicas.podSecurityContext.fsGroup }}
139 {{- if .Values.shmVolume.enabled }}
140 chmod -R 777 /dev/shm
142 {{- if .Values.tls.enabled }}
143 cp /tmp/certs/* /opt/bitnami/postgresql/certs/
144 {{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
145 chown -R `id -u`:`id -G | cut -d " " -f2` /opt/bitnami/postgresql/certs/
147 chown -R {{ .Values.readReplicas.containerSecurityContext.runAsUser }}:{{ .Values.readReplicas.podSecurityContext.fsGroup }} /opt/bitnami/postgresql/certs/
149 chmod 600 {{ include "postgresql.tlsCertKey" . }}
151 {{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
152 securityContext: {{- omit .Values.volumePermissions.containerSecurityContext "runAsUser" | toYaml | nindent 12 }}
154 securityContext: {{- .Values.volumePermissions.containerSecurityContext | toYaml | nindent 12 }}
157 {{ if .Values.readReplicas.persistence.enabled }}
159 mountPath: {{ .Values.readReplicas.persistence.mountPath }}
160 {{- if .Values.readReplicas.persistence.subPath }}
161 subPath: {{ .Values.readReplicas.persistence.subPath }}
164 {{- if .Values.shmVolume.enabled }}
168 {{- if .Values.tls.enabled }}
169 - name: raw-certificates
170 mountPath: /tmp/certs
171 - name: postgresql-certificates
172 mountPath: /opt/bitnami/postgresql/certs
175 {{- if .Values.readReplicas.initContainers }}
176 {{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.initContainers "context" $ ) | nindent 8 }}
180 image: {{ include "postgresql.image" . }}
181 imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
182 {{- if .Values.readReplicas.containerSecurityContext.enabled }}
183 securityContext: {{- omit .Values.readReplicas.containerSecurityContext "enabled" | toYaml | nindent 12 }}
185 {{- if .Values.diagnosticMode.enabled }}
186 command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
187 {{- else if .Values.readReplicas.command }}
188 command: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.command "context" $) | nindent 12 }}
190 {{- if .Values.diagnosticMode.enabled }}
191 args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
192 {{- else if .Values.readReplicas.args }}
193 args: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.args "context" $) | nindent 12 }}
196 - name: BITNAMI_DEBUG
197 value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
198 - name: POSTGRESQL_PORT_NUMBER
199 value: {{ .Values.containerPorts.postgresql | quote }}
200 - name: POSTGRESQL_VOLUME_DIR
201 value: {{ .Values.readReplicas.persistence.mountPath | quote }}
202 {{- if .Values.readReplicas.persistence.mountPath }}
204 value: {{ .Values.postgresqlDataDir | quote }}
207 {{- if and (not (empty $customUser)) (ne $customUser "postgres") .Values.auth.enablePostgresUser }}
208 {{- if .Values.auth.usePasswordFiles }}
209 - name: POSTGRES_POSTGRES_PASSWORD_FILE
210 value: "/opt/bitnami/postgresql/secrets/postgres-password"
212 - name: POSTGRES_POSTGRES_PASSWORD
215 name: {{ include "postgresql.secretName" . }}
216 key: {{ include "postgresql.adminPasswordKey" . }}
219 {{- if .Values.auth.usePasswordFiles }}
220 - name: POSTGRES_PASSWORD_FILE
221 value: {{ printf "/opt/bitnami/postgresql/secrets/%s" (ternary "password" "postgres-password" (and (not (empty $customUser)) (ne $customUser "postgres"))) }}
223 - name: POSTGRES_PASSWORD
226 name: {{ include "postgresql.secretName" . }}
227 key: {{ include "postgresql.userPasswordKey" . }}
230 - name: POSTGRES_REPLICATION_MODE
232 - name: POSTGRES_REPLICATION_USER
233 value: {{ .Values.auth.replicationUsername | quote }}
234 {{- if .Values.auth.usePasswordFiles }}
235 - name: POSTGRES_REPLICATION_PASSWORD_FILE
236 value: "/opt/bitnami/postgresql/secrets/replication-password"
238 - name: POSTGRES_REPLICATION_PASSWORD
241 name: {{ include "postgresql.secretName" . }}
242 key: {{ include "postgresql.replicationPasswordKey" . }}
244 - name: POSTGRES_CLUSTER_APP_NAME
245 value: {{ .Values.replication.applicationName }}
246 - name: POSTGRES_MASTER_HOST
247 value: {{ include "postgresql.primary.fullname" . }}
248 - name: POSTGRES_MASTER_PORT_NUMBER
249 value: {{ include "postgresql.service.port" . | quote }}
251 - name: POSTGRESQL_ENABLE_TLS
252 value: {{ ternary "yes" "no" .Values.tls.enabled | quote }}
253 {{- if .Values.tls.enabled }}
254 - name: POSTGRESQL_TLS_PREFER_SERVER_CIPHERS
255 value: {{ ternary "yes" "no" .Values.tls.preferServerCiphers | quote }}
256 - name: POSTGRESQL_TLS_CERT_FILE
257 value: {{ include "postgresql.tlsCert" . }}
258 - name: POSTGRESQL_TLS_KEY_FILE
259 value: {{ include "postgresql.tlsCertKey" . }}
260 {{- if .Values.tls.certCAFilename }}
261 - name: POSTGRESQL_TLS_CA_FILE
262 value: {{ include "postgresql.tlsCACert" . }}
264 {{- if .Values.tls.crlFilename }}
265 - name: POSTGRESQL_TLS_CRL_FILE
266 value: {{ include "postgresql.tlsCRL" . }}
270 - name: POSTGRESQL_LOG_HOSTNAME
271 value: {{ .Values.audit.logHostname | quote }}
272 - name: POSTGRESQL_LOG_CONNECTIONS
273 value: {{ .Values.audit.logConnections | quote }}
274 - name: POSTGRESQL_LOG_DISCONNECTIONS
275 value: {{ .Values.audit.logDisconnections | quote }}
276 {{- if .Values.audit.logLinePrefix }}
277 - name: POSTGRESQL_LOG_LINE_PREFIX
278 value: {{ .Values.audit.logLinePrefix | quote }}
280 {{- if .Values.audit.logTimezone }}
281 - name: POSTGRESQL_LOG_TIMEZONE
282 value: {{ .Values.audit.logTimezone | quote }}
284 {{- if .Values.audit.pgAuditLog }}
285 - name: POSTGRESQL_PGAUDIT_LOG
286 value: {{ .Values.audit.pgAuditLog | quote }}
288 - name: POSTGRESQL_PGAUDIT_LOG_CATALOG
289 value: {{ .Values.audit.pgAuditLogCatalog | quote }}
291 - name: POSTGRESQL_CLIENT_MIN_MESSAGES
292 value: {{ .Values.audit.clientMinMessages | quote }}
293 - name: POSTGRESQL_SHARED_PRELOAD_LIBRARIES
294 value: {{ .Values.postgresqlSharedPreloadLibraries | quote }}
295 {{- if .Values.readReplicas.extraEnvVars }}
296 {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.extraEnvVars "context" $) | nindent 12 }}
298 {{- if or .Values.readReplicas.extraEnvVarsCM .Values.readReplicas.extraEnvVarsSecret }}
300 {{- if .Values.readReplicas.extraEnvVarsCM }}
302 name: {{ .Values.readReplicas.extraEnvVarsCM }}
304 {{- if .Values.readReplicas.extraEnvVarsSecret }}
306 name: {{ .Values.readReplicas.extraEnvVarsSecret }}
310 - name: tcp-postgresql
311 containerPort: {{ .Values.containerPorts.postgresql }}
312 {{- if not .Values.diagnosticMode.enabled }}
313 {{- if .Values.readReplicas.customStartupProbe }}
314 startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.customStartupProbe "context" $) | nindent 12 }}
315 {{- else if .Values.readReplicas.startupProbe.enabled }}
316 startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readReplicas.startupProbe "enabled") "context" $) | nindent 12 }}
321 {{- if (include "postgresql.database" .) }}
322 - exec pg_isready -U {{ default "postgres" $customUser| quote }} -d "dbname={{ include "postgresql.database" . }} {{- if and .Values.tls.enabled .Values.tls.certCAFilename }} sslcert={{ include "postgresql.tlsCert" . }} sslkey={{ include "postgresql.tlsCertKey" . }}{{- end }}" -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }}
324 - exec pg_isready -U {{ default "postgres" $customUser | quote }} {{- if and .Values.tls.enabled .Values.tls.certCAFilename }} -d "sslcert={{ include "postgresql.tlsCert" . }} sslkey={{ include "postgresql.tlsCertKey" . }}"{{- end }} -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }}
327 {{- if .Values.readReplicas.customLivenessProbe }}
328 livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.customLivenessProbe "context" $) | nindent 12 }}
329 {{- else if .Values.readReplicas.livenessProbe.enabled }}
330 livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readReplicas.livenessProbe "enabled") "context" $) | nindent 12 }}
335 {{- if (include "postgresql.database" .) }}
336 - exec pg_isready -U {{ default "postgres" $customUser | quote }} -d "dbname={{ include "postgresql.database" . }} {{- if and .Values.tls.enabled .Values.tls.certCAFilename }} sslcert={{ include "postgresql.tlsCert" . }} sslkey={{ include "postgresql.tlsCertKey" . }}{{- end }}" -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }}
338 - exec pg_isready -U {{default "postgres" $customUser | quote }} {{- if and .Values.tls.enabled .Values.tls.certCAFilename }} -d "sslcert={{ include "postgresql.tlsCert" . }} sslkey={{ include "postgresql.tlsCertKey" . }}"{{- end }} -h 127.0.0.1 -p {{ .Values.containerPorts.postgresql }}
341 {{- if .Values.readReplicas.customReadinessProbe }}
342 readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.customReadinessProbe "context" $) | nindent 12 }}
343 {{- else if .Values.readReplicas.readinessProbe.enabled }}
344 readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readReplicas.readinessProbe "enabled") "context" $) | nindent 12 }}
350 {{- include "postgresql.readinessProbeCommand" . | nindent 16 }}
353 {{- if .Values.readReplicas.resources }}
354 resources: {{- toYaml .Values.readReplicas.resources | nindent 12 }}
356 {{- if .Values.readReplicas.lifecycleHooks }}
357 lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.lifecycleHooks "context" $) | nindent 12 }}
360 {{- if .Values.auth.usePasswordFiles }}
361 - name: postgresql-password
362 mountPath: /opt/bitnami/postgresql/secrets/
364 {{- if .Values.readReplicas.extendedConfiguration }}
365 - name: postgresql-extended-config
366 mountPath: /bitnami/postgresql/conf/conf.d/
368 {{- if .Values.tls.enabled }}
369 - name: postgresql-certificates
370 mountPath: /opt/bitnami/postgresql/certs
373 {{- if .Values.shmVolume.enabled }}
377 {{- if .Values.readReplicas.persistence.enabled }}
379 mountPath: {{ .Values.readReplicas.persistence.mountPath }}
380 {{- if .Values.readReplicas.persistence.subPath }}
381 subPath: {{ .Values.readReplicas.persistence.subPath }}
384 {{- if .Values.readReplicas.extraVolumeMounts }}
385 {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.extraVolumeMounts "context" $) | nindent 12 }}
387 {{- if .Values.metrics.enabled }}
389 image: {{ include "postgresql.metrics.image" . }}
390 imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
391 {{- if .Values.metrics.containerSecurityContext.enabled }}
392 securityContext: {{- omit .Values.metrics.containerSecurityContext "enabled" | toYaml | nindent 12 }}
394 {{- if .Values.diagnosticMode.enabled }}
395 command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
396 args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
397 {{- else if .Values.metrics.customMetrics }}
398 args: [ "--extend.query-path", "/conf/custom-metrics.yaml" ]
401 {{- $database := required "In order to enable metrics you need to specify a database (.Values.auth.database or .Values.global.postgresql.auth.database)" (include "postgresql.database" .) }}
402 - name: DATA_SOURCE_URI
403 value: {{ printf "127.0.0.1:%d/%s?sslmode=disable" (int (include "postgresql.service.port" .)) $database }}
404 {{- if .Values.auth.usePasswordFiles }}
405 - name: DATA_SOURCE_PASS_FILE
406 value: {{ printf "/opt/bitnami/postgresql/secrets/%s" (ternary "password" "postgres-password" (and (not (empty $customUser)) (ne $customUser "postgres"))) }}
408 - name: DATA_SOURCE_PASS
411 name: {{ include "postgresql.secretName" . }}
412 key: {{ include "postgresql.userPasswordKey" . }}
414 - name: DATA_SOURCE_USER
415 value: {{ default "postgres" $customUser | quote }}
416 {{- if .Values.metrics.extraEnvVars }}
417 {{- include "common.tplvalues.render" (dict "value" .Values.metrics.extraEnvVars "context" $) | nindent 12 }}
421 containerPort: {{ .Values.metrics.containerPorts.metrics }}
422 {{- if not .Values.diagnosticMode.enabled }}
423 {{- if .Values.metrics.customStartupProbe }}
424 startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customStartupProbe "context" $) | nindent 12 }}
425 {{- else if .Values.metrics.startupProbe.enabled }}
426 startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.startupProbe "enabled") "context" $) | nindent 12 }}
430 {{- if .Values.metrics.customLivenessProbe }}
431 livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customLivenessProbe "context" $) | nindent 12 }}
432 {{- else if .Values.metrics.livenessProbe.enabled }}
433 livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.livenessProbe "enabled") "context" $) | nindent 12 }}
438 {{- if .Values.metrics.customReadinessProbe }}
439 readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customReadinessProbe "context" $) | nindent 12 }}
440 {{- else if .Values.metrics.readinessProbe.enabled }}
441 readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.readinessProbe "enabled") "context" $) | nindent 12 }}
448 {{- if .Values.auth.usePasswordFiles }}
449 - name: postgresql-password
450 mountPath: /opt/bitnami/postgresql/secrets/
452 {{- if .Values.metrics.customMetrics }}
453 - name: custom-metrics
457 {{- if .Values.metrics.resources }}
458 resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
461 {{- if .Values.readReplicas.sidecars }}
462 {{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.sidecars "context" $ ) | nindent 8 }}
465 {{- if .Values.readReplicas.extendedConfiguration }}
466 - name: postgresql-extended-config
468 name: {{ include "postgresql.readReplicas.extendedConfigmapName" . }}
470 {{- if .Values.auth.usePasswordFiles }}
471 - name: postgresql-password
473 secretName: {{ include "postgresql.secretName" . }}
475 {{- if .Values.tls.enabled }}
476 - name: raw-certificates
478 secretName: {{ include "postgresql.tlsSecretName" . }}
479 - name: postgresql-certificates
482 {{- if and .Values.metrics.enabled .Values.metrics.customMetrics }}
483 - name: custom-metrics
485 name: {{ printf "%s-metrics" (include "common.names.fullname" .) }}
487 {{- if .Values.shmVolume.enabled }}
491 {{- if .Values.shmVolume.sizeLimit }}
492 sizeLimit: {{ .Values.shmVolume.sizeLimit }}
495 {{- if .Values.readReplicas.extraVolumes }}
496 {{- include "common.tplvalues.render" ( dict "value" .Values.readReplicas.extraVolumes "context" $ ) | nindent 8 }}
498 {{- if and .Values.readReplicas.persistence.enabled .Values.readReplicas.persistence.existingClaim }}
500 persistentVolumeClaim:
501 claimName: {{ tpl .Values.readReplicas.persistence.existingClaim $ }}
502 {{- else if not .Values.readReplicas.persistence.enabled }}
506 volumeClaimTemplates:
509 {{- if .Values.readReplicas.persistence.annotations }}
510 annotations: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.persistence.annotations "context" $) | nindent 10 }}
512 {{- if .Values.readReplicas.persistence.labels }}
513 labels: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.persistence.labels "context" $) | nindent 10 }}
517 {{- range .Values.readReplicas.persistence.accessModes }}
520 {{- if .Values.readReplicas.persistence.dataSource }}
521 dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.persistence.dataSource "context" $) | nindent 10 }}
525 storage: {{ .Values.readReplicas.persistence.size | quote }}
526 {{- if .Values.readReplicas.persistence.selector }}
527 selector: {{- include "common.tplvalues.render" (dict "value" .Values.readReplicas.persistence.selector "context" $) | nindent 10 }}
529 {{- include "common.storage.class" (dict "persistence" .Values.readReplicas.persistence "global" .Values.global) | nindent 8 }}