-
Notifications
You must be signed in to change notification settings - Fork 0
/
cronjob.yml
39 lines (39 loc) · 1.06 KB
/
cronjob.yml
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
apiVersion: batch/v1
kind: CronJob
metadata:
name: etcd-maintanence
namespace: default
spec:
# every day at 4 am
schedule: "0 4 * * *"
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
jobTemplate:
spec:
# 6 hours ttl to troubleshoot any potential problems
ttlSecondsAfterFinished: 3600
parallelism: 1
backoffLimit: 1
template:
spec:
containers:
- name: etcd-maintainer
image: ugurozturk99/etcdctl:v0.0.27-SNAPSHOT
command: ["etcdctldefrag"]
env:
- name: PROMETHEUSSVC
value: "prometheus-service"
- name: PROMETHEUSNS
value: "namespace"
volumeMounts:
- mountPath: /etc/secret-volume
name: secret-volume
readOnly: true
volumes:
- name: secret-volume
secret:
defaultMode: 420
secretName: etcd-certs
serviceAccount: etcd-maintainer
restartPolicy: Never