forked from target/pod-reaper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.yml
82 lines (82 loc) · 2.86 KB
/
deployment.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
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
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: pod-reaper
spec:
replicas: 1
template:
metadata:
labels:
# used to exclude pod-reaper so it does not reap itself (optional)
pod-reaper: disabled
spec:
# this configures three different pod-reapers in one pod, each with their own criteria for reaping; if one
# pod-reaper decides to reap a pod, the pod will be deleted
containers:
- name: chaos-after-2min
image: target/pod-reaper:latest
imagePullPolicy: Never # set to never for local minikube testing
resources:
limits:
cpu: 30m
memory: 30Mi
requests:
cpu: 20m
memory: 20Mi
# this configuration looks at all pods in the "default" namespace without the label pod-reaper: disabled and
# will delete 30% of found pods thare have been running for more than 2 minutes
env:
# only look for pods in the "default" namespace
- name: NAMESPACE
value: default
# check pods every 30 seconds
- name: POLL_INTERVAL
value: 30s
# exclude pods with metadata label pod-reaper: disabled
- name: EXCLUDE_LABEL_KEY
value: pod-reaper
- name: EXCLUDE_LABEL_VALUES
value: disabled
# flag pods that have been alive for more than 2 minutes
- name: MAX_DURATION
value: 2m
# randomly flag 30% of pods whenever they are checked
- name: CHAOS_CHANCE
value: ".3"
- name: chaos
image: target/pod-reaper:latest
imagePullPolicy: Never # set to never for local minikube testing
resources:
limits:
cpu: 30m
memory: 30Mi
requests:
cpu: 20m
memory: 20Mi
# this configuration looks at all pods, in every namespace every 15 seconds, and deletes 5% of them.
env:
# check pods every 15 seconds
- name: POLL_INTERVAL
value: 15s
# randomly flag 5% of pods whenever they are checked
- name: CHAOS_CHANCE
value: ".05"
- name: error
image: target/pod-reaper:latest
imagePullPolicy: Never # set to never for local minikube testing
resources:
limits:
cpu: 30m
memory: 30Mi
requests:
cpu: 20m
memory: 20Mi
# this configuration looks at all pods, in every namespace every 3 minutes and deletes any with a container
# with status of Error or ErrImagePull
env:
# check pods every 15 seconds
- name: POLL_INTERVAL
value: 3m
# randomly flag 5% of pods whenever they are checked
- name: CONTAINER_STATUSES
value: "Error,ErrImagePull,ImagePullBackOff"