Skip to content

Commit c35acd7

Browse files
authored
Merge pull request #135 from Linkurious/feature/OPS-2727
OPS-2727: modify schedule for primary backup and create a secondary backup for redondancy
2 parents f45f059 + 4679886 commit c35acd7

5 files changed

Lines changed: 97 additions & 21 deletions

File tree

charts/linkurious-enterprise/README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# linkurious-enterprise
22

3-
![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.10.18](https://img.shields.io/badge/AppVersion-2.10.18-informational?style=flat-square)
3+
![Version: 0.3.1](https://img.shields.io/badge/Version-0.3.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 4.3.4](https://img.shields.io/badge/AppVersion-4.3.4-informational?style=flat-square)
44

55
A Helm chart for Linkurious Enterprise
66

@@ -31,7 +31,7 @@ To install a very basic version of Linkurious enterprise, please set your privat
3131
and then run:
3232

3333
```console
34-
helm upgrade --install my-release linkurious-enterprise-0.3.0.tgz -f chart-value-examples/basic/values.yaml
34+
helm upgrade --install my-release linkurious-enterprise-0.3.1.tgz -f chart-value-examples/basic/values.yaml
3535
```
3636

3737
## Values
@@ -65,18 +65,26 @@ helm upgrade --install my-release linkurious-enterprise-0.3.0.tgz -f chart-value
6565
| backup.litestream.resources.requests.cpu | string | `"100m"` | |
6666
| backup.litestream.resources.requests.memory | string | `"100Mi"` | |
6767
| backup.litestream.secretRef.name | string | `"litestream-lke-secret"` | |
68-
| backup.velero.defaultVolumesToFsBackup | bool | `false` | |
6968
| backup.velero.enabled | bool | `false` | |
7069
| backup.velero.includedResources[0] | string | `"pvc"` | |
7170
| backup.velero.includedResources[1] | string | `"pv"` | |
7271
| backup.velero.instance | string | `"velero-preprod"` | |
7372
| backup.velero.labels."app.kubernetes.io/name" | string | `"linkurious-enterprise"` | |
7473
| backup.velero.labelsSelector."app.kubernetes.io/name" | string | `"linkurious-enterprise"` | |
7574
| backup.velero.name | string | `"velero"` | |
76-
| backup.velero.schedule | string | `"55 3 */2 * *"` | |
75+
| backup.velero.primaryBackup.defaultVolumesToFsBackup | bool | `false` | |
76+
| backup.velero.primaryBackup.schedule | string | `"55 3 * * *"` | |
77+
| backup.velero.primaryBackup.snapshotMoveData | bool | `false` | |
78+
| backup.velero.primaryBackup.snapshotVolume | bool | `true` | |
79+
| backup.velero.primaryBackup.ttl | string | `"168h"` | |
80+
| backup.velero.secondaryBackup.defaultVolumesToFsBackup | bool | `true` | |
81+
| backup.velero.secondaryBackup.enabled | bool | `false` | |
82+
| backup.velero.secondaryBackup.schedule | string | `"55 12 * * *"` | |
83+
| backup.velero.secondaryBackup.snapshotMoveData | bool | `true` | |
84+
| backup.velero.secondaryBackup.snapshotVolume | bool | `true` | |
85+
| backup.velero.secondaryBackup.storageLocation | string | `"velero-k8s-nl-ams-backup-storage"` | |
86+
| backup.velero.secondaryBackup.ttl | string | `"168h"` | |
7787
| backup.velero.skipImmediately | bool | `false` | |
78-
| backup.velero.snapshotVolume | bool | `true` | |
79-
| backup.velero.ttl | string | `"168h"` | |
8088
| backup.velero.veleroNamespace | string | `"backup"` | |
8189
| config | object | `{"server":{"allowFraming":false,"cookieHttpOnly":true,"forceHttps":false,"useHttps":false},"version":"{{ .Chart.AppVersion }}"}` | Linkurious Enterprise configuration overlay. Values here are rendered into a ConfigMap mounted as overlay.json. Supports $ENV:VAR_NAME (string) and $ENV-JSON:VAR_NAME (JSON boolean) variable expansion at runtime. Ref: https://doc.linkurio.us/admin-manual/latest/configure/ |
8290
| configOverlayEnabled | bool | `true` | Manage LKE configmap (Declarative Setup) # Ref: https://doc.linkurio.us/admin-manual/latest/configure/#variable-expansion |

charts/linkurious-enterprise/templates/statefulset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
{{- with .Values.podAnnotations }}
2020
{{- toYaml . | nindent 8 }}
2121
{{- end }}
22-
{{- if .Values.backup.velero.enabled }}
22+
{{- if or .Values.backup.velero.enabled .Values.backup.velero.secondaryBackup.enabled }}
2323
backup.velero.io/backup-volumes: lke-data
2424
{{- end }}
2525
labels:

charts/linkurious-enterprise/templates/velero-schedule.yaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@ metadata:
1212
{{- toYaml .Values.backup.velero.annotations | nindent 4 }}
1313
{{- end }}
1414
labels:
15-
app.kubernetes.io/name: {{ .Values.backup.velero.name }}
16-
app.kubernetes.io/instance: {{ .Values.backup.velero.instance }}
17-
app.kubernetes.io/managed-by: {{ $.Release.Service }}
18-
{{- if .Values.backup.velero.labels }}
19-
{{- toYaml .Values.backup.velero.labels | nindent 4 }}
20-
{{- end }}
15+
{{- $defaultLabels := dict "app.kubernetes.io/name" .Values.backup.velero.name "app.kubernetes.io/instance" .Values.backup.velero.instance "app.kubernetes.io/managed-by" $.Release.Service }}
16+
{{- toYaml (mergeOverwrite $defaultLabels (.Values.backup.velero.labels | default dict)) | nindent 4 }}
2117

2218
spec:
2319
{{- if .Values.backup.velero.paused }}
@@ -26,10 +22,10 @@ spec:
2622
{{- if .Values.backup.velero.useOwnerReferencesInBackup }}
2723
useOwnerReferencesInBackup: {{ .Values.backup.velero.useOwnerReferencesInBackup }}
2824
{{- end }}
29-
schedule: {{ .Values.backup.velero.schedule }}
25+
schedule: {{ .Values.backup.velero.primaryBackup.schedule }}
3026
skipImmediately: {{ .Values.backup.velero.skipImmediately }}
3127
template:
32-
defaultVolumesToFsBackup: {{ .Values.backup.velero.defaultVolumesToFsBackup }}
28+
defaultVolumesToFsBackup: {{ .Values.backup.velero.primaryBackup.defaultVolumesToFsBackup }}
3329
includedNamespaces:
3430
- {{ $.Release.Namespace }}
3531
{{- if .Values.backup.velero.includedResources }}
@@ -49,6 +45,12 @@ spec:
4945
matchLabels:
5046
{{- toYaml .Values.backup.velero.labelsSelector | nindent 8 }}
5147
{{- end }}
52-
snapshotVolumes: {{ .Values.backup.velero.snapshotVolume }}
53-
ttl: {{ .Values.backup.velero.ttl }}
48+
{{- if .Values.backup.velero.primaryBackup.snapshotMoveData }}
49+
snapshotMoveData: {{ .Values.backup.velero.primaryBackup.snapshotMoveData }}
50+
{{- end }}
51+
snapshotVolumes: {{ .Values.backup.velero.primaryBackup.snapshotVolume }}
52+
{{- if .Values.backup.velero.primaryBackup.storageLocation }}
53+
storageLocation: {{ .Values.backup.velero.primaryBackup.storageLocation }}
54+
{{- end }}
55+
ttl: {{ .Values.backup.velero.primaryBackup.ttl }}
5456
{{- end }}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{{- if .Values.backup.velero.secondaryBackup.enabled }}
2+
{{- if (not (.Capabilities.APIVersions.Has "velero.io/v1")) }}
3+
{{- fail "ERROR: You have to deploy velero.io/v1 first or disable velero backup" }}
4+
{{- end }}
5+
apiVersion: velero.io/v1
6+
kind: Schedule
7+
metadata:
8+
name: {{ printf "velero-secondary-schedule-%s" $.Release.Namespace }}
9+
namespace: {{ .Values.backup.velero.veleroNamespace }}
10+
{{- if .Values.backup.velero.annotations }}
11+
annotations:
12+
{{- toYaml .Values.backup.velero.annotations | nindent 4 }}
13+
{{- end }}
14+
labels:
15+
{{- $defaultLabels := dict "app.kubernetes.io/name" .Values.backup.velero.name "app.kubernetes.io/instance" .Values.backup.velero.instance "app.kubernetes.io/managed-by" $.Release.Service }}
16+
{{- toYaml (mergeOverwrite $defaultLabels (.Values.backup.velero.labels | default dict)) | nindent 4 }}
17+
18+
spec:
19+
{{- if .Values.backup.velero.paused }}
20+
paused: {{ .Values.backup.velero.paused }}
21+
{{- end }}
22+
{{- if .Values.backup.velero.useOwnerReferencesInBackup }}
23+
useOwnerReferencesInBackup: {{ .Values.backup.velero.useOwnerReferencesInBackup }}
24+
{{- end }}
25+
schedule: {{ .Values.backup.velero.secondaryBackup.schedule }}
26+
skipImmediately: {{ .Values.backup.velero.skipImmediately }}
27+
template:
28+
defaultVolumesToFsBackup: {{ .Values.backup.velero.secondaryBackup.defaultVolumesToFsBackup }}
29+
includedNamespaces:
30+
- {{ $.Release.Namespace }}
31+
{{- if .Values.backup.velero.includedResources }}
32+
includedResources:
33+
{{- range .Values.backup.velero.includedResources }}
34+
- {{ . }}
35+
{{- end }}
36+
{{- end }}
37+
{{- if .Values.backup.velero.excludedResources }}
38+
excludedResources:
39+
{{- range .Values.backup.velero.excludedResources }}
40+
- {{ . }}
41+
{{- end }}
42+
{{- end }}
43+
{{- if .Values.backup.velero.labelsSelector }}
44+
labelSelector:
45+
matchLabels:
46+
{{- toYaml .Values.backup.velero.labelsSelector | nindent 8 }}
47+
{{- end }}
48+
{{- if .Values.backup.velero.secondaryBackup.snapshotMoveData }}
49+
snapshotMoveData: {{ .Values.backup.velero.secondaryBackup.snapshotMoveData }}
50+
{{- end }}
51+
snapshotVolumes: {{ .Values.backup.velero.secondaryBackup.snapshotVolume }}
52+
{{- if .Values.backup.velero.secondaryBackup.storageLocation }}
53+
storageLocation: {{ .Values.backup.velero.secondaryBackup.storageLocation }}
54+
{{- end }}
55+
ttl: {{ .Values.backup.velero.secondaryBackup.ttl }}
56+
{{- end }}

charts/linkurious-enterprise/values.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,21 +285,31 @@ backup:
285285
name: velero
286286
instance: velero-preprod
287287
veleroNamespace: backup
288-
ttl: "168h"
289288
includedResources:
290289
- pvc
291290
- pv
292291
#excludedResources:
293292
# - secrets
294-
snapshotVolume: true
295-
defaultVolumesToFsBackup: false
296293
labels:
297294
app.kubernetes.io/name: linkurious-enterprise
298-
schedule: "55 3 */2 * *"
299295
skipImmediately: false
300296
labelsSelector:
301297
# backup.velero.io/backup-volumes: lke-data
302298
app.kubernetes.io/name: linkurious-enterprise
299+
primaryBackup:
300+
snapshotVolume: true
301+
snapshotMoveData: false
302+
defaultVolumesToFsBackup: false
303+
schedule: "55 3 * * *"
304+
ttl: "168h"
305+
secondaryBackup:
306+
enabled: false
307+
schedule: "55 12 * * *"
308+
snapshotVolume: true
309+
snapshotMoveData: true
310+
defaultVolumesToFsBackup: true
311+
storageLocation: velero-k8s-nl-ams-backup-storage
312+
ttl: "168h"
303313

304314
hostAliases: []
305315

0 commit comments

Comments
 (0)