-
Notifications
You must be signed in to change notification settings - Fork 2
/
daemonset.yaml
53 lines (52 loc) · 1.58 KB
/
daemonset.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
#
# This Kubernetes specification file shows how to deploy Gurobi Compute Server
# nodes as a daemon set on dedicated worker nodes:
# - by using a daemon set, we run one and only one Gurobi Compute Server per worker node as an agent
# - then, the node selector indicates that the daemon will only run on the specified nodes
# - finally by defining a taint app:compute on the worker nodes, and applying the tolerations
# to the daemon set, we make sure no other pods will run on these nodes.
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: gurobi-compute
labels:
app: gurobi-compute
spec:
selector:
matchLabels:
app: gurobi-compute
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
template:
metadata:
labels:
app: gurobi-compute
spec:
volumes:
- name: gurobi-lic
secret:
secretName: gurobi-lic
containers:
- name: gurobi-compute
image: gurobi/compute:12.0.0
ports:
- containerPort: 61000
volumeMounts:
- name: gurobi-lic
mountPath: "/opt/gurobi"
readOnly: true
env:
- name: MY_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
args: [ "--manager","http://$(GUROBI_MANAGER_SERVICE_HOST):$(GUROBI_MANAGER_SERVICE_PORT)", "--hostname", "$(MY_POD_IP)"]
nodeSelector:
app: compute
tolerations:
- key: "app"
operator: "Equal"
value: "compute"
effect: "NoSchedule"