-
Notifications
You must be signed in to change notification settings - Fork 189
Expand file tree
/
Copy pathbackup.yaml
More file actions
54 lines (54 loc) · 1.38 KB
/
backup.yaml
File metadata and controls
54 lines (54 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: dremio-jobs-role
namespace: {{.Release.Namespace}}
rules:
- apiGroups: [""]
resources: ["pods", "pods/exec"]
verbs: ["get", "list", "watch", "create"]
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: dremio-jobs
namespace: {{.Release.Namespace}}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: dremio-jobs
namespace: {{.Release.Namespace}}
subjects:
- kind: ServiceAccount
name: dremio-jobs
namespace: {{.Release.Namespace}}
roleRef:
kind: Role
name: dremio-jobs-role
apiGroup: rbac.authorization.k8s.io
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: dremio-backup-s3
namespace: {{.Release.Namespace}}
spec:
schedule: "0 */3 * * *"
failedJobsHistoryLimit: 1
successfulJobsHistoryLimit: 1
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
containers:
- name: backup
image: bitnami/kubectl:latest
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- kubectl exec dremio-master-0 --container dremio-master-coordinator -- /opt/dremio/bin/dremio-admin backup -l -d dremioS3:///{{ $.Values.distStorage.aws.bucketName }}/backup/daily
restartPolicy: Never
serviceAccountName: dremio-jobs