File tree Expand file tree Collapse file tree 4 files changed +74
-14
lines changed Expand file tree Collapse file tree 4 files changed +74
-14
lines changed Original file line number Diff line number Diff line change 1
1
{ {/* Allow for S3 secret information to be stored in a Secret */} }
2
2
{ {- define " postgres.s3" } }
3
3
[global]
4
- { {- if .Values. s3 } }
5
- { {- if .Values .s3.key } }
6
- repo1 -s3-key={ { .Values .s3.key } }
7
- { {- end } }
8
- { {- if .Values .s3.keySecret } }
9
- repo1 -s3-key-secret={ { .Values .s3.keySecret } }
10
- { {- end } }
11
- { {- if .Values .s3.encryptionPassphrase } }
12
- repo1 -cipher-pass={ { .Values .s3.encryptionPassphrase } }
13
- { {- end } }
4
+ { {- if .s3 } }
5
+ { {- if .s3.key } }
6
+ repo { { add .index 1 } } -s3-key={ { .s3.key } }
7
+ { {- end } }
8
+ { {- if .s3.keySecret } }
9
+ repo { { add .index 1 } } -s3-key-secret={ { .s3.keySecret } }
10
+ { {- end } }
11
+ { {- if .s3.encryptionPassphrase } }
12
+ repo { { add .index 1 } } -cipher-pass={ { .s3.encryptionPassphrase } }
13
+ { {- end } }
14
14
{ {- end } }
15
15
{ { end } }
Original file line number Diff line number Diff line change 1
- {{- if .Values.s3 }}
1
+ {{- if or .Values.multiBackupRepos .Values.s3 }}
2
2
apiVersion : v1
3
3
kind : Secret
4
4
metadata :
5
5
name : {{ default .Release.Name .Values.name }}-pgbackrest-secret
6
6
type : Opaque
7
7
data :
8
+ {{- if .Values.multiBackupRepos }}
9
+ {{- range $index, $repo := .Values.multiBackupRepos }}
10
+ {{- if $repo.s3 }}
11
+ {{- $args := dict "s3" $repo.s3 "index" $index }}
8
12
s3.conf : |-
9
- {{ include "postgres.s3" . | b64enc }}
13
+ {{ include "postgres.s3" $args | b64enc }}
14
+ {{- end }}
15
+ {{- end }}
16
+ {{- else if .Values.s3 }}
17
+ {{- $args := dict "s3" .Values.s3 "index" 0 }}
18
+ s3.conf : |-
19
+ {{ include "postgres.s3" $args | b64enc }}
20
+ {{- end }}
10
21
{{- end }}
Original file line number Diff line number Diff line change 40
40
{{- end }}
41
41
{{- if .Values.pgBackRestConfig }}
42
42
{{ toYaml .Values.pgBackRestConfig | indent 6 }}
43
+ {{- else if .Values.multiBackupRepos }}
44
+ configuration :
45
+ - secret :
46
+ name : {{ default .Release.Name .Values.name }}-pgbackrest-secret
47
+ global :
48
+ {{- range $index, $repo := .Values.multiBackupRepos }}
49
+ {{- if $repo.s3 }}
50
+ repo{{ add $index 1 }}-path : /pgbackrest/{{ $.Release.Namespace }}/{{ default $.Release.Name $.Values.name }}/repo{{ add $index 1 }}
51
+ {{- end }}
52
+ {{- end }}
53
+ repos :
54
+ {{- range $index, $repo := .Values.multiBackupRepos }}
55
+ - name : repo{{ add $index 1 }}
56
+ {{- if $repo.volume }}
57
+ volume :
58
+ volumeClaimSpec :
59
+ accessModes :
60
+ - " ReadWriteOnce"
61
+ resources :
62
+ requests :
63
+ storage : {{ default "1Gi" $repo.volume.backupsSize | quote }}
64
+ {{- else if $repo.s3 }}
65
+ s3 :
66
+ bucket : {{ $repo.s3.bucket | quote }}
67
+ endpoint : {{ $repo.s3.endpoint | quote }}
68
+ region : {{ $repo.s3.region | quote }}
69
+ {{- end }}
70
+ {{- end }}
43
71
{{- else if .Values.s3 }}
44
72
configuration :
45
73
- secret :
Original file line number Diff line number Diff line change 165
165
# Backups / pgBackRest Settings #
166
166
# ################################
167
167
168
- # backupsSize sets the storage size of the backups to a PVC. This can be
169
- # overridden by "pgBackRestConfig", if set. Defaults to the value velow.
168
+ # backupsSize sets the storage size of the backups to a volume in Kubernetes.
169
+ # can be overridden by "pgBackRestConfig", if set. Defaults to the value velow.
170
170
# backupsSize: 1Gi
171
171
172
172
# s3 allows for AWS S3 or an S3 compatible storage system to be used for
189
189
# # built-in encrpytion system.
190
190
# encryptionPassphrase: ""
191
191
192
+ # multiBackupRepos allows for backing up to multiple repositories. This is
193
+ # effectively uses the "quickstarts" for each of the backup types (volume, s3,
194
+ # gcs, azure). You can have any permutation of these types. You can set up to 4.
195
+ # can be overwritten by "pgBackRestConfig".
196
+ #
197
+ # You can't set "multiBackupRepos" and any of the individual quickstarts at the
198
+ # same time. "multiBackupRepos" will take precedence.
199
+ #
200
+ # Below is an example that enables one of each backup type. Note all of the
201
+ # available quickstart options are presented below; please see the backup types
202
+ # if you want to see how each option works.
203
+ # multiBackupRepos:
204
+ # - volume:
205
+ # backupsSize: 1Gi
206
+ # - s3:
207
+ # bucket: ""
208
+ # endpoint: ""
209
+ # region: ""
210
+ # key: ""
211
+ # keySecret: ""
212
+
192
213
# pgBackRestConfig allows for the configuration of every pgBackRest option
193
214
# except for "image", which is set by "pgBackRest".
194
215
# pgBackRestConfig: {}
You can’t perform that action at this time.
0 commit comments