backup.yaml
3.43 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
apiVersion: batch/v1
kind: CronJob
metadata:
name: backup-secrets-do-backup
spec:
schedule: "13 * * * *"
startingDeadlineSeconds: 3600
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 10
failedJobsHistoryLimit: 10
jobTemplate:
spec:
template:
spec:
serviceAccountName: backup-secrets
restartPolicy: OnFailure
volumes:
- name: work-space
emptyDir: {}
- name: config
configMap:
name: backup-secrets-config
- name: scripts
configMap:
name: backup-secrets-scripts
defaultMode: 0755
- name: aws-config
configMap:
name: backup-secrets-aws-config
items:
- key: config
path: config
- name: aws-credentials
secret:
secretName: backup-secrets-aws-credentials
items:
- key: credentials
path: credentials
initContainers:
- name: list-s3
image: peakcom/s5cmd
command: ["/scripts/backup"]
args: ["list-s3"]
volumeMounts:
- name: work-space
mountPath: /work-space
- name: config
mountPath: /config
- name: scripts
mountPath: /scripts
- mountPath: /root/.aws/config
name: aws-config
subPath: config
- mountPath: /root/.aws/credentials
name: aws-credentials
subPath: credentials
- name: calculate-delete-s3
image: debian
command: ["/scripts/backup"]
args: ["calculate-delete-s3"]
volumeMounts:
- name: work-space
mountPath: /work-space
- name: config
mountPath: /config
- name: scripts
mountPath: /scripts
- name: create-secrets-tarball
image: bitnami/kubectl
command: ["/scripts/backup"]
args: ["create-secrets-tarball"]
volumeMounts:
- name: work-space
mountPath: /work-space
- name: config
mountPath: /config
- name: scripts
mountPath: /scripts
- name: copy-to-s3
image: peakcom/s5cmd
command: ["/scripts/backup"]
args: ["copy-to-s3"]
volumeMounts:
- name: work-space
mountPath: /work-space
- name: config
mountPath: /config
- name: scripts
mountPath: /scripts
- mountPath: /root/.aws/config
name: aws-config
subPath: config
- mountPath: /root/.aws/credentials
name: aws-credentials
subPath: credentials
containers:
- name: show-backup
image: debian
command: ["/scripts/backup"]
args: ["show-backup"]
volumeMounts:
- name: work-space
mountPath: /work-space
- name: scripts
mountPath: /scripts