-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcronjob.yaml
92 lines (92 loc) · 2.98 KB
/
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
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
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: cronjob-etcd-backup
labels:
purpose: etcd-backup
spec:
concurrencyPolicy: Forbid
jobTemplate:
spec:
backoffLimit: 0
template:
spec:
activeDeadlineSeconds: 200
containers:
- name: etcd-backup
command:
- /bin/sh
- '-c'
- >-
/usr/local/bin/etcd-backup.sh && ls -1
/etcd-backup/* | sort -r | tail -n +6 | xargs
rm -rf > /dev/null 2>&1
env: null
image: >-
quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:6a2378154881e6f9a4638f41242518d850e19b0d7d9ef74a2be55b87f4625e87
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: 300m
memory: 250Mi
securityContext:
privileged: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- name: certs
mountPath: /etc/ssl/etcd/
- name: conf
mountPath: /etc/etcd/
- name: kubeconfig
mountPath: /etc/kubernetes/
- name: etcd-backup-script
mountPath: /usr/local/bin/etcd-backup.sh
subPath: etcd-backup.sh
- name: etcd-backup-script
mountPath: >-
/usr/local/bin/etcd-snapshot-backup-disconnected.sh
subPath: etcd-snapshot-backup-disconnected.sh
- name: etcd-backup
mountPath: /etcd-backup
- name: scripts
mountPath: /usr/local/bin
hostNetwork: true
nodeSelector:
node-role.kubernetes.io/master: ''
restartPolicy: Never
serviceAccount: approver
serviceAccountName: approver
tolerations:
- effect: NoSchedule
operator: Exists
- effect: NoExecute
operator: Exists
volumes:
- name: certs
hostPath:
path: >-
/etc/kubernetes/static-pod-resources/etcd-member
type: ''
- name: conf
hostPath:
path: /etc/etcd
type: ''
- name: kubeconfig
hostPath:
path: /etc/kubernetes
type: ''
- name: scripts
hostPath:
path: /usr/local/bin
type: ''
- name: etcd-backup
persistentVolumeClaim:
claimName: etcd-backup
- name: etcd-backup-script
configMap:
name: etcd-backup-script
defaultMode: 493
schedule: '0 */6 * * *'
startingDeadlineSeconds: 200
suspend: false