forked from IBM/kube-safe-scheduler
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathextender.safe.congestion.yaml
executable file
·126 lines (126 loc) · 3 KB
/
extender.safe.congestion.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
apiVersion: v1
kind: ConfigMap
metadata:
name: my-scheduler-config
namespace: kube-system
data:
config.yaml: |
apiVersion: kubescheduler.config.k8s.io/v1alpha1
kind: KubeSchedulerConfiguration
schedulerName: my-scheduler
algorithmSource:
policy:
configMap:
namespace: kube-system
name: my-scheduler-policy
leaderElection:
leaderElect: true
lockObjectName: my-scheduler
lockObjectNamespace: kube-system
---
apiVersion: v1
kind: ConfigMap
metadata:
name: my-scheduler-policy
namespace: kube-system
data:
policy.cfg : |
{
"kind" : "Policy",
"apiVersion" : "v1",
"extenders" : [{
"urlPrefix": "http://localhost:5401/scheduler",
"filterVerb": "predicates/safe-overload",
"prioritizeVerb": "priorities/safe-overload",
"preemptVerb": "",
"bindVerb": "",
"weight": 1,
"enableHttps": false,
"nodeCacheCapable": false
},
{
"urlPrefix": "http://localhost:5402/scheduler",
"filterVerb": "",
"prioritizeVerb": "priorities/congestion",
"preemptVerb": "",
"bindVerb": "",
"weight": 1,
"enableHttps": false,
"nodeCacheCapable": false
}]
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-scheduler
namespace: kube-system
labels:
app: my-scheduler
spec:
replicas: 1
selector:
matchLabels:
app: my-scheduler
template:
metadata:
labels:
app: my-scheduler
spec:
volumes:
- name: my-scheduler-config
configMap:
name: my-scheduler-config
containers:
- name: my-scheduler-ctr
image: gcr.io/google_containers/hyperkube:v1.13.5
imagePullPolicy: IfNotPresent
args:
- kube-scheduler
- --config=/my-scheduler/config.yaml
- -v=4
volumeMounts:
- name: my-scheduler-config
mountPath: /my-scheduler
- name: my-extender-ctr-1
image: kube-sched-ext-safe:0.0
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /version
port: 5401
readinessProbe:
httpGet:
path: /version
port: 5401
ports:
- containerPort: 5401
env:
- name: SAFEUTILIZATION
value: "90"
- name: SAFEPERCENTILE
value: "30"
- name: SAFEPRINTTABLE
value: "false"
- name: SAFEFORECASTWEIGHT
value: "20"
- name: HTTP_PORT
value: "5401"
- name: my-extender-ctr-2
image: kube-sched-ext-congestion:0.0
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /version
port: 5402
readinessProbe:
httpGet:
path: /version
port: 5402
ports:
- containerPort: 5402
env:
- name: CONGESTION_FACTOR_MAX
value: "10"
- name: HTTP_PORT
value: "5402"