forked from IBM/kube-safe-scheduler
-
Notifications
You must be signed in to change notification settings - Fork 1
/
extender.safe.yaml
executable file
·106 lines (106 loc) · 2.47 KB
/
extender.safe.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
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/scheduler",
"filterVerb": "predicates/safe-overload",
"prioritizeVerb": "priorities/safe-overload",
"preemptVerb": "",
"bindVerb": "",
"weight": 1,
"enableHttps": false,
"nodeCacheCapable": false
},
{
"urlPrefix": "http://localhost/scheduler",
"filterVerb": "",
"prioritizeVerb": "priorities/safe-balance",
"preemptVerb": "",
"bindVerb": "",
"weight": 10,
"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: 80
readinessProbe:
httpGet:
path: /version
port: 80
ports:
- containerPort: 80
env:
- name: SAFEUTILIZATION
value: "90"
- name: SAFEPERCENTILE
value: "30"
- name: SAFEPRINTTABLE
value: "false"
- name: SAFEFORECASTWEIGHT
value: "20"