-
Notifications
You must be signed in to change notification settings - Fork 29
/
high-cpu-usage-cronjob.yaml
49 lines (49 loc) · 1.29 KB
/
high-cpu-usage-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
apiVersion: batch/v1
kind: CronJob
metadata:
name: enable-high-cpu-usage
spec:
schedule: "00 04 * * *"
jobTemplate:
spec:
ttlSecondsAfterFinished: 60
template:
spec:
containers:
- name: enable-high-cpu-usage
image: curlimages/curl
imagePullPolicy: IfNotPresent
args:
- "http://feature-flag-service:8080/v1/flags/high_cpu_usage"
- "-X"
- "PUT"
- "-H"
- "Content-Type: application/json"
- "-d"
- '{"enabled": true}'
restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: disable-high-cpu-usage
spec:
schedule: "25 04 * * *"
jobTemplate:
spec:
ttlSecondsAfterFinished: 60
template:
spec:
containers:
- name: disable-high-cpu-usage
image: curlimages/curl
imagePullPolicy: IfNotPresent
args:
- "http://feature-flag-service:8080/v1/flags/high_cpu_usage"
- "-X"
- "PUT"
- "-H"
- "Content-Type: application/json"
- "-d"
- '{"enabled": false}'
restartPolicy: OnFailure