-
Notifications
You must be signed in to change notification settings - Fork 9
/
s3-backup-cronjob.yaml
43 lines (40 loc) · 1.03 KB
/
s3-backup-cronjob.yaml
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
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: backup-cronjob
spec:
schedule: "0 */6 * * *"
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 2
failedJobsHistoryLimit: 1
jobTemplate:
spec:
template:
spec:
containers:
- name: s3databackup
image: d3fk/s3cmd:latest
args:
- sync
- --ssl
- --server-side-encryption
- --server-side-encryption-kms-id= ${YOUR_KMS_KEY_ID}
- --recursive
- --no-check-md5
- /tmp/DATA/
- s3://${YOUR_BUCKET_NAME}/DATA/
volumeMounts:
- name: data
mountPath: /tmp/DATA
- name: s3config
mountPath: /root/.s3cfg
subPath: .s3cfg
volumes:
- name: s3config
configMap:
name: s3config
- name: data
nfs:
server: ${NFS_SERVER}
path: /${SHARED-FOLDER}/
restartPolicy: Never