{{ if and (.Values.backup.enabled) (eq .Values.backup.method "objectStore") }} {{ $context := . -}} {{ range .Values.backup.objectStore -}} --- apiVersion: barmancloud.cnpg.io/v1 kind: ObjectStore metadata: name: "{{ include "cluster.name" $context }}-{{ .name }}-backup" namespace: {{ include "cluster.namespace" $context }} labels: {{- include "cluster.labels" $context | nindent 4 }} spec: retentionPolicy: {{ .retentionPolicy }} configuration: destinationPath: {{ .destinationPath }} endpointURL: {{ .endpointURL }} {{ if .endpointCA.name }} endpointCA: name: {{ .endpointCA.name }} key: {{ .endpointCA.key }} {{ end }} {{- if .clusterName }} serverName: "{{ .clusterName }}-backup-{{ .index }}" {{- else }} serverName: "{{ include "cluster.name" $context }}-backup-{{ .index }}" {{- end }} wal: compression: {{ .wal.compression }} {{- with .wal.encryption}} encryption: {{ . }} {{- end }} maxParallel: {{ .wal.maxParallel }} data: compression: {{ .data.compression }} {{- with .data.encryption }} encryption: {{ . }} {{- end }} jobs: {{ .data.jobs }} s3Credentials: accessKeyId: {{- if not (empty .endpointCredentials) }} name: {{ .endpointCredentials }} {{- else }} name: {{- printf "%s-backup-secret" (include "cluster.name" $context) | trunc 63 | trimSuffix "-" -}} {{- end }} key: ACCESS_KEY_ID secretAccessKey: {{- if .endpointCredentials }} name: {{ .endpointCredentials }} {{- else }} name: {{- printf "%s-backup-secret" (include "cluster.name" $context) | trunc 63 | trimSuffix "-" -}} {{- end }} key: ACCESS_SECRET_KEY {{ end -}} {{ end }} {{ if eq .Values.recovery.method "objectStore" }} --- apiVersion: barmancloud.cnpg.io/v1 kind: ObjectStore metadata: name: "{{ include "cluster.name" . }}-{{ .Values.recovery.objectStore.name }}" namespace: {{ include "cluster.namespace" . }} labels: {{- include "cluster.labels" . | nindent 4 }} spec: configuration: destinationPath: {{ .Values.recovery.objectStore.destinationPath }} endpointURL: {{ .Values.recovery.objectStore.endpointURL }} {{- if .Values.recovery.objectStore.endpointCA.name }} endpointCA: name: {{ .Values.recovery.objectStore.endpointCA.name }} key: {{ .Values.recovery.objectStore.endpointCA.key }} {{- end }} serverName: {{ include "cluster.recoveryServerName" . }} wal: compression: {{ .Values.recovery.objectStore.wal.compression }} {{- with .Values.recovery.objectStore.wal.encryption}} encryption: {{ . }} {{- end }} maxParallel: {{ .Values.recovery.objectStore.wal.maxParallel }} data: compression: {{ .Values.recovery.objectStore.data.compression }} {{- with .Values.recovery.objectStore.data.encryption }} encryption: {{ . }} {{- end }} jobs: {{ .Values.recovery.objectStore.data.jobs }} s3Credentials: accessKeyId: name: {{ include "cluster.recoveryCredentials" . }} key: ACCESS_KEY_ID secretAccessKey: name: {{ include "cluster.recoveryCredentials" . }} key: ACCESS_SECRET_KEY {{ end }}