-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathk8s-ds-amdgpu-labeller.yaml
99 lines (99 loc) · 2.45 KB
/
k8s-ds-amdgpu-labeller.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
# This is a configuration example for the node labeller which includes
# ClusterRole and ClusterRoleBinding definitions, as well as the
# DeamonSet configuration that deploys the actual node labeller
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: cr-node-labeller
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["watch", "get", "list", "update"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: labeller
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cr-node-labeller
subjects:
- kind: ServiceAccount
name: node-labeller-sa
namespace: kube-system
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: node-labeller-sa
namespace: kube-system
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: amdgpu-labeller-daemonset
namespace: kube-system
spec:
selector:
matchLabels:
name: amdgpu-lr-ds
template:
metadata:
labels:
name: amdgpu-lr-ds
spec:
serviceAccountName: node-labeller-sa
nodeSelector:
kubernetes.io/arch: amd64
priorityClassName: system-node-critical
tolerations:
- key: CriticalAddonsOnly
operator: Exists
containers:
- image: rocm/k8s-device-plugin:labeller-latest
name: amdgpu-lr-cntr
imagePullPolicy: Always
workingDir: /root
command: ["./k8s-node-labeller"]
args: ["-vram", "-cu-count", "-simd-count", "-device-id", "-family"]
env:
- name: DS_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
securityContext:
privileged: true #Needed for /dev
capabilities:
drop: ["ALL"]
volumeMounts:
- name: sys
mountPath: /sys
readOnly: true
- name: dev-kfd
mountPath: /dev/kfd
readOnly: true
- name: dev-dri
mountPath: /dev/dri
readOnly: true
resources: {}
# limits:
# memory: 20Mi
# cpu: 100m
# requests:
# memory: 30Mi
# cpu: 150m
volumes:
- name: sys
hostPath:
path: /sys
type: Directory
- name: dev-kfd
hostPath:
path: /dev/kfd
type: CharDevice
- name: dev-dri
hostPath:
path: /dev/dri
type: Directory