-
Notifications
You must be signed in to change notification settings - Fork 13
/
k8s-shredder.yaml
88 lines (88 loc) · 2.3 KB
/
k8s-shredder.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
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: k8s-shredder
namespace: kube-system
labels:
app: k8s-shredder
spec:
replicas: 1
selector:
matchLabels:
app: k8s-shredder
template:
metadata:
labels:
app: k8s-shredder
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: node.kubernetes.io/role
operator: In
values:
- master
tolerations:
- key: "node-role.kubernetes.io/control-plane"
operator: "Exists"
effect: "NoSchedule"
serviceAccountName: k8s-shredder
containers:
- name: k8s-shredder
image: adobe/k8s-shredder:dev # replace it with a stable version
args:
- "--config=/k8s-shredder-config/config.yaml"
- "--metrics-port=8080"
- "--log-level=info"
# For running it in dry run, without taking any real eviction actions
# - "--dry-run"
ports:
- containerPort: 8080
resources:
requests:
cpu: 250m
memory: 250M
limits:
cpu: "1"
memory: 1Gi
volumeMounts:
- name: k8s-shredder-config-volume
mountPath: /k8s-shredder-config
volumes:
- name: k8s-shredder-config-volume
configMap:
defaultMode: 420
name: k8s-shredder-config
---
apiVersion: v1
kind: ConfigMap
metadata:
name: k8s-shredder-config
namespace: kube-system
data:
config.yaml: |-
EvictionLoopInterval: 10s
ParkedNodeTTL: 30s
RollingRestartThreshold: 0.5
UpgradeStatusLabel: "shredder.ethos.adobe.net/upgrade-status"
ExpiresOnLabel: "shredder.ethos.adobe.net/parked-node-expires-on"
NamespacePrefixSkipInitialEviction: "ns-ethos-"
RestartedAtAnnotation: "shredder.ethos.adobe.net/restartedAt"
AllowEvictionLabel: "shredder.ethos.adobe.net/allow-eviction"
ToBeDeletedTaint: "ToBeDeletedByClusterAutoscaler"
---
apiVersion: v1
kind: Service
metadata:
name: k8s-shredder
namespace: kube-system
spec:
selector:
app: k8s-shredder
ports:
- port: 8080
targetPort: 8080