{{- if .Values.postgresql.enabled }} apiVersion: postgresql.cnpg.io/v1 kind: Cluster metadata: name: {{ include "sogo.fullname" . }}-postgres labels: {{- include "sogo.labels" . | nindent 4 }} spec: instances: {{ .Values.postgresql.instances }} primaryUpdateStrategy: unsupervised bootstrap: initdb: database: {{ .Values.postgresql.database }} owner: {{ .Values.postgresql.username }} secret: name: {{ include "sogo.fullname" . }}-postgres-credentials postInitSQL: - CREATE EXTENSION IF NOT EXISTS pg_trgm; storage: storageClass: {{ .Values.postgresql.storage.storageClass }} size: {{ .Values.postgresql.storage.size }} postgresql: parameters: shared_buffers: {{ .Values.postgresql.sharedBuffers }} max_connections: {{ .Values.postgresql.maxConnections | quote }} log_destination: 'csvlog' logging_collector: 'on' log_filename: 'postgres' log_rotation_age: '0' log_rotation_size: '0' pg_hba: - host all all all scram-sha-256 monitoring: enablePodMonitor: false {{- end }}