-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfigure_nodescheduler.sh
More file actions
executable file
·75 lines (70 loc) · 1.69 KB
/
configure_nodescheduler.sh
File metadata and controls
executable file
·75 lines (70 loc) · 1.69 KB
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
#! /bin/bash
nodeID=$1
if [ -z ${nodeID} ]; then
echo "Please specify node name (or ID)."
echo "Usage: ./configure_nodescheduler.sh 00000000000001"
exit 1
fi
echo "Generating k3s objects for node scheduler..."
cat <<EOF > nodescheduler.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: wes-plugin-scheduler
spec:
selector:
matchLabels:
app: wes-plugin-scheduler
template:
metadata:
labels:
app: wes-plugin-scheduler
spec:
priorityClassName: wes-high-priority
serviceAccountName: wes-plugin-scheduler
containers:
- image: waggle/scheduler:0.9.3
name: wes-plugin-scheduler
command: ["/app/nodescheduler"]
args:
- -in-cluster
envFrom:
- configMapRef:
name: wes-identity
env:
- name: WAGGLE_APP_ID
valueFrom:
fieldRef:
fieldPath: metadata.uid
WAGGLE_APP_ID
resources:
limits:
cpu: 200m
memory: 150Mi
requests:
cpu: 100m
memory: 100Mi
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: wes-plugin-scheduler-view
namespace: default
roleRef:
kind: ClusterRole
name: edit
apiGroup: rbac.authorization.k8s.io
# `edit` is a built-in cluster role. more info about these can be found here:
# https://kubernetes.io/docs/reference/access-authn-authz/rbac/#user-facing-roles
subjects:
- kind: ServiceAccount
name: wes-plugin-scheduler
namespace: default
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: wes-plugin-scheduler
EOF
echo "Done."
echo "To launch node scheduler, kubectl apply -f nodescheduler.yaml"