-
Notifications
You must be signed in to change notification settings - Fork 1
/
ncs2-device-plugin.yaml
79 lines (79 loc) · 2.07 KB
/
ncs2-device-plugin.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
kind: ServiceAccount
apiVersion: v1
metadata:
name: ncs2-device-plugin
namespace: kube-system
labels:
addonmanager.kubernetes.io/mode: Reconcile
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: system:ncs2-device-plugin
labels:
addonmanager.kubernetes.io/mode: Reconcile
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list", "patch", "update", "get"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: system:ncs2-device-plugin
labels:
addonmanager.kubernetes.io/mode: Reconcile
subjects:
- kind: ServiceAccount
name: ncs2-device-plugin
namespace: kube-system
roleRef:
kind: ClusterRole
name: system:ncs2-device-plugin
apiGroup: rbac.authorization.k8s.io
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: ncs2-device-plugin
namespace: kube-system
spec:
selector:
matchLabels:
name: ncs2-device-plugin
template:
metadata:
labels:
name: ncs2-device-plugin
spec:
serviceAccountName: ncs2-device-plugin
volumes:
# pyudev depends on udev events being passed through from the host
- name: host-udev
hostPath:
path: "/run/udev"
containers:
- name: ncs2-device-plugin
image: adaptant/ncs2-device-plugin:latest
volumeMounts:
- name: host-udev
mountPath: "/run/udev"
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
# k8s-auto-labeller
- key: accelerators/ncs2
operator: Exists
- matchExpressions:
# USB-attached NCS2 (using NFD discovery)
- key: feature.node.kubernetes.io/usb-ff_03e7_2485.present
operator: In
values:
- "true"