From 3628e800154792cdaebbb8a3474c817471e4c9ad Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Sat, 13 Jan 2024 11:47:30 -0600 Subject: [PATCH] Add device detection for nvidia gpu. --- .../system/node-feature-discovery/ks.yaml | 19 +++++++++++++++++++ .../node-feature-discovery/rules/nvidia.yaml | 15 +++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 kubernetes/apps/system/node-feature-discovery/rules/nvidia.yaml diff --git a/kubernetes/apps/system/node-feature-discovery/ks.yaml b/kubernetes/apps/system/node-feature-discovery/ks.yaml index 6ca8d68f..83f41794 100644 --- a/kubernetes/apps/system/node-feature-discovery/ks.yaml +++ b/kubernetes/apps/system/node-feature-discovery/ks.yaml @@ -17,3 +17,22 @@ spec: kind: GitRepository name: homelab wait: true +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: cluster-apps-node-feature-discovery-rules + namespace: flux-system + labels: + substitution.flux.home.arpa/enabled: "true" +spec: + interval: 10m + path: "./kubernetes/apps/system/node-feature-discovery/rules" + prune: true + sourceRef: + kind: GitRepository + name: homelab + wait: true + dependsOn: + - name: node-feature-discovery diff --git a/kubernetes/apps/system/node-feature-discovery/rules/nvidia.yaml b/kubernetes/apps/system/node-feature-discovery/rules/nvidia.yaml new file mode 100644 index 00000000..34fe935e --- /dev/null +++ b/kubernetes/apps/system/node-feature-discovery/rules/nvidia.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: nfd.k8s-sigs.io/v1alpha1 +kind: NodeFeatureRule +metadata: + name: nvidia-device +spec: + rules: + - # NVIDIA GPU + name: nvidia.com/gpu + labels: + nvidia.com/gpu.present: "true" + matchFeatures: + - feature: pci.device + matchExpressions: + vendor: { op: In, value: ["10de"] }