48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
# Config for: NVIDIA GPU device plugin
|
|
# Applied by: kubectl apply -f manifests/home-services/nvidia-device-plugin.yaml
|
|
# Description: Exposes nvidia.com/gpu resource on gpu-node so K3s can schedule GPU workloads.
|
|
---
|
|
apiVersion: node.k8s.io/v1
|
|
kind: RuntimeClass
|
|
metadata:
|
|
name: nvidia
|
|
handler: nvidia
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: DaemonSet
|
|
metadata:
|
|
name: nvidia-device-plugin
|
|
namespace: kube-system
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: nvidia-device-plugin
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: nvidia-device-plugin
|
|
spec:
|
|
runtimeClassName: nvidia
|
|
tolerations:
|
|
- key: spot
|
|
operator: Equal
|
|
value: "true"
|
|
effect: NoSchedule
|
|
nodeSelector:
|
|
nik4nao.com/gpu: "true"
|
|
containers:
|
|
- name: nvidia-device-plugin
|
|
image: nvcr.io/nvidia/k8s-device-plugin:v0.17.0
|
|
args:
|
|
- --device-discovery-strategy=nvml
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
capabilities:
|
|
drop: [ALL]
|
|
volumeMounts:
|
|
- name: device-plugin
|
|
mountPath: /var/lib/kubelet/device-plugins
|
|
volumes:
|
|
- name: device-plugin
|
|
hostPath:
|
|
path: /var/lib/kubelet/device-plugins |