apiVersion: postgresql.cnpg.io/v1 kind: Cluster metadata: name: {{ include "cnpg-cluster.fullname" . }} namespace: {{ include "cnpg-cluster.namespace" . }} labels: {{- include "cnpg-cluster.labels" . | nindent 4 }} {{- with .Values.extraLabels }} {{- toYaml . | nindent 4 }} {{- end }} {{- with .Values.extraAnnotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: instances: {{ .Values.instances }} imageName: {{ include "cnpg-cluster.image" . }} primaryUpdateStrategy: {{ .Values.primaryUpdateStrategy }} primaryUpdateMethod: {{ .Values.primaryUpdateMethod }} enableSuperuserAccess: {{ .Values.enableSuperuserAccess }} postgresql: {{- with .Values.postgresql.parameters }} parameters: {{- range $k, $v := . }} {{ $k }}: {{ $v | quote }} {{- end }} {{- end }} {{- with .Values.postgresql.sharedPreloadLibraries }} shared_preload_libraries: {{- toYaml . | nindent 6 }} {{- end }} {{- with .Values.postgresql.pg_hba }} pg_hba: {{- toYaml . | nindent 6 }} {{- end }} {{- with .Values.postgresql.synchronous }} synchronous: {{- toYaml . | nindent 6 }} {{- end }} bootstrap: initdb: database: {{ .Values.bootstrap.initdb.database }} owner: {{ .Values.bootstrap.initdb.owner }} {{- with .Values.bootstrap.initdb.secretName }} secret: name: {{ . }} {{- end }} {{- with .Values.bootstrap.initdb.encoding }} encoding: {{ . }} {{- end }} {{- with .Values.bootstrap.initdb.localeCollate }} localeCollate: {{ . }} {{- end }} {{- with .Values.bootstrap.initdb.localeCType }} localeCType: {{ . }} {{- end }} {{- with .Values.bootstrap.initdb.postInitApplicationSQL }} postInitApplicationSQL: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.bootstrap.initdb.postInitApplicationSQLRefs }} {{- if or .configMapRefs .secretRefs }} postInitApplicationSQLRefs: {{- with .secretRefs }} secretRefs: {{- toYaml . | nindent 10 }} {{- end }} {{- with .configMapRefs }} configMapRefs: {{- toYaml . | nindent 10 }} {{- end }} {{- end }} {{- end }} storage: size: {{ .Values.storage.size }} {{- with .Values.storage.storageClass }} storageClass: {{ . }} {{- end }} {{- if .Values.walStorage.enabled }} walStorage: size: {{ .Values.walStorage.size }} {{- with .Values.walStorage.storageClass }} storageClass: {{ . }} {{- end }} {{- end }} resources: {{- toYaml .Values.resources | nindent 4 }} affinity: enablePodAntiAffinity: {{ .Values.affinity.enablePodAntiAffinity }} podAntiAffinityType: {{ .Values.affinity.podAntiAffinityType }} topologyKey: {{ .Values.affinity.topologyKey }} {{- with .Values.affinity.nodeSelector }} nodeSelector: {{- toYaml . | nindent 6 }} {{- end }} {{- with .Values.affinity.tolerations }} tolerations: {{- toYaml . | nindent 6 }} {{- end }} monitoring: enablePodMonitor: {{ .Values.monitoring.enablePodMonitor }} {{- with .Values.monitoring.customQueriesConfigMap }} customQueriesConfigMap: {{- toYaml . | nindent 6 }} {{- end }} {{- if .Values.backup.enabled }} backup: retentionPolicy: {{ .Values.backup.retentionPolicy }} barmanObjectStore: destinationPath: {{ required "backup.enabled=true 이면 backup.barmanObjectStore.destinationPath 가 필요하다" .Values.backup.barmanObjectStore.destinationPath }} {{- with .Values.backup.barmanObjectStore.endpointURL }} endpointURL: {{ . }} {{- end }} s3Credentials: accessKeyId: name: {{ required "backup.enabled=true 이면 s3Credentials.accessKeyId.name 이 필요하다" .Values.backup.barmanObjectStore.s3Credentials.accessKeyId.name }} key: {{ .Values.backup.barmanObjectStore.s3Credentials.accessKeyId.key }} secretAccessKey: name: {{ required "backup.enabled=true 이면 s3Credentials.secretAccessKey.name 이 필요하다" .Values.backup.barmanObjectStore.s3Credentials.secretAccessKey.name }} key: {{ .Values.backup.barmanObjectStore.s3Credentials.secretAccessKey.key }} wal: {{- toYaml .Values.backup.barmanObjectStore.wal | nindent 8 }} data: {{- toYaml .Values.backup.barmanObjectStore.data | nindent 8 }} {{- end }}