|
| 1 | +{{- if and .Values.backups.enabled (eq (include "cluster.useBarmanCloudPlugin" .) "true") }} |
| 2 | +apiVersion: barmancloud.cnpg.io/v1 |
| 3 | +kind: ObjectStore |
| 4 | +metadata: |
| 5 | + name: {{ include "cluster.barmanCloudObjectStoreName" . }} |
| 6 | + namespace: {{ include "cluster.namespace" $ }} |
| 7 | + {{- with .Values.cluster.annotations }} |
| 8 | + annotations: |
| 9 | + {{- toYaml . | nindent 4 }} |
| 10 | + {{- end }} |
| 11 | + labels: |
| 12 | + {{- include "cluster.labels" . | nindent 4 }} |
| 13 | + {{- with .Values.cluster.additionalLabels }} |
| 14 | + {{ toYaml . | nindent 4 }} |
| 15 | + {{- end }} |
| 16 | +spec: |
| 17 | + {{- with .Values.backups.instanceSidecarConfiguration }} |
| 18 | + instanceSidecarConfiguration: |
| 19 | + {{- toYaml . | nindent 4 }} |
| 20 | + {{- end }} |
| 21 | + {{- with .Values.backups.retentionPolicy }} |
| 22 | + retentionPolicy: {{ . }} |
| 23 | + {{- end }} |
| 24 | + configuration: |
| 25 | + {{- if .Values.backups.endpointURL }} |
| 26 | + endpointURL: {{ .Values.backups.endpointURL | quote }} |
| 27 | + {{- end }} |
| 28 | + {{- if or (.Values.backups.endpointCA.create) (.Values.backups.endpointCA.name) }} |
| 29 | + endpointCA: |
| 30 | + name: {{ .Values.backups.endpointCA.name }} |
| 31 | + key: {{ .Values.backups.endpointCA.key }} |
| 32 | + {{- end }} |
| 33 | + {{- if eq .Values.backups.provider "s3" }} |
| 34 | + {{- if empty .Values.backups.endpointURL }} |
| 35 | + endpointURL: "https://s3.{{ required "You need to specify S3 region if endpointURL is not specified." .Values.backups.s3.region }}.amazonaws.com" |
| 36 | + {{- end }} |
| 37 | + destinationPath: {{ default (printf "s3://%s%s" (required "You need to specify S3 bucket." .Values.backups.s3.bucket) .Values.backups.s3.path) .Values.backups.destinationPath }} |
| 38 | + {{- $secretName := coalesce .Values.backups.secret.name (printf "%s-backup-s3-creds" (include "cluster.fullname" .)) }} |
| 39 | + s3Credentials: |
| 40 | + {{- if .Values.backups.s3.inheritFromIAMRole }} |
| 41 | + inheritFromIAMRole: true |
| 42 | + {{- else }} |
| 43 | + accessKeyId: |
| 44 | + name: {{ $secretName }} |
| 45 | + key: ACCESS_KEY_ID |
| 46 | + secretAccessKey: |
| 47 | + name: {{ $secretName }} |
| 48 | + key: ACCESS_SECRET_KEY |
| 49 | + {{- end }} |
| 50 | + {{- else if eq .Values.backups.provider "azure" }} |
| 51 | + destinationPath: {{ default (printf "https://%s.%s.core.windows.net/%s%s" (required "You need to specify Azure storageAccount." .Values.backups.azure.storageAccount) .Values.backups.azure.serviceName .Values.backups.azure.containerName .Values.backups.azure.path) .Values.backups.destinationPath }} |
| 52 | + {{- $secretName := coalesce .Values.backups.secret.name (printf "%s-backup-azure-creds" (include "cluster.fullname" .)) }} |
| 53 | + azureCredentials: |
| 54 | + {{- if .Values.backups.azure.inheritFromAzureAD }} |
| 55 | + inheritFromAzureAD: true |
| 56 | + {{- else if .Values.backups.azure.connectionString }} |
| 57 | + connectionString: |
| 58 | + name: {{ $secretName }} |
| 59 | + key: AZURE_CONNECTION_STRING |
| 60 | + {{- else }} |
| 61 | + storageAccount: |
| 62 | + name: {{ $secretName }} |
| 63 | + key: AZURE_STORAGE_ACCOUNT |
| 64 | + {{- if .Values.backups.azure.storageKey }} |
| 65 | + storageKey: |
| 66 | + name: {{ $secretName }} |
| 67 | + key: AZURE_STORAGE_KEY |
| 68 | + {{- else }} |
| 69 | + storageSasToken: |
| 70 | + name: {{ $secretName }} |
| 71 | + key: AZURE_STORAGE_SAS_TOKEN |
| 72 | + {{- end }} |
| 73 | + {{- end }} |
| 74 | + {{- else if eq .Values.backups.provider "google" }} |
| 75 | + destinationPath: {{ default (printf "gs://%s%s" (required "You need to specify Google storage bucket." .Values.backups.google.bucket) .Values.backups.google.path) .Values.backups.destinationPath }} |
| 76 | + {{- $secretName := coalesce .Values.backups.secret.name (printf "%s-backup-google-creds" (include "cluster.fullname" .)) }} |
| 77 | + googleCredentials: |
| 78 | + gkeEnvironment: {{ .Values.backups.google.gkeEnvironment }} |
| 79 | + {{- if not .Values.backups.google.gkeEnvironment }} |
| 80 | + applicationCredentials: |
| 81 | + name: {{ $secretName }} |
| 82 | + key: APPLICATION_CREDENTIALS |
| 83 | + {{- end }} |
| 84 | + {{- end }} |
| 85 | + wal: |
| 86 | + compression: {{ .Values.backups.wal.compression }} |
| 87 | + {{- if .Values.backups.wal.encryption }} |
| 88 | + encryption: {{ .Values.backups.wal.encryption }} |
| 89 | + {{- end }} |
| 90 | + maxParallel: {{ .Values.backups.wal.maxParallel }} |
| 91 | + data: |
| 92 | + compression: {{ .Values.backups.data.compression }} |
| 93 | + {{- if .Values.backups.data.encryption }} |
| 94 | + encryption: {{ .Values.backups.data.encryption }} |
| 95 | + {{- end }} |
| 96 | + jobs: {{ .Values.backups.data.jobs }} |
| 97 | +{{- end }} |
0 commit comments