From 10b88eff133769cf8b67385886e9fa57e8ed0e59 Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Wed, 11 May 2022 00:39:21 +0200
Subject: [PATCH] feat(drivers): Add AMD GPU drivers

This patch enables AMD GPU drivers for usage with pods in the cluster.
---
 infrastructure/drivers/amd-gpu.yaml       | 28 +++++++++++++++++++++++
 infrastructure/drivers/kustomization.yaml |  7 ++++++
 infrastructure/drivers/namespace.yaml     |  7 ++++++
 infrastructure/kustomization.yaml         |  1 +
 4 files changed, 43 insertions(+)
 create mode 100644 infrastructure/drivers/amd-gpu.yaml
 create mode 100644 infrastructure/drivers/kustomization.yaml
 create mode 100644 infrastructure/drivers/namespace.yaml

diff --git a/infrastructure/drivers/amd-gpu.yaml b/infrastructure/drivers/amd-gpu.yaml
new file mode 100644
index 000000000..81ddd3806
--- /dev/null
+++ b/infrastructure/drivers/amd-gpu.yaml
@@ -0,0 +1,28 @@
+---
+apiVersion: source.toolkit.fluxcd.io/v1beta1
+kind: HelmRepository
+metadata:
+  name: amd-gpu
+  namespace: drivers-system
+spec:
+  interval: 30m
+  url: https://radeonopencompute.github.io/k8s-device-plugin/
+---
+apiVersion: helm.toolkit.fluxcd.io/v2beta1
+kind: HelmRelease
+metadata:
+  name: amd-gpu
+  namespace: drivers-system
+spec:
+  releaseName: amd-gpu
+  chart:
+    spec:
+      chart: amd-gpu
+      sourceRef:
+        kind: HelmRepository
+        name: amd-gpu
+        namespace: drivers-system
+      version: 0.2.0
+  interval: 5m
+  values:
+    namespace: drivers-system
diff --git a/infrastructure/drivers/kustomization.yaml b/infrastructure/drivers/kustomization.yaml
new file mode 100644
index 000000000..22ea8ec76
--- /dev/null
+++ b/infrastructure/drivers/kustomization.yaml
@@ -0,0 +1,7 @@
+apiVersion: kustomize.config.k8s.io/v1beta1
+kind: Kustomization
+namespace: drivers-system
+resources:
+  - namespace.yaml
+  - amd-gpu.yaml
+  - ../../shared/networkpolicies/deny-by-default.yaml
diff --git a/infrastructure/drivers/namespace.yaml b/infrastructure/drivers/namespace.yaml
new file mode 100644
index 000000000..09f50de0c
--- /dev/null
+++ b/infrastructure/drivers/namespace.yaml
@@ -0,0 +1,7 @@
+apiVersion: v1
+kind: Namespace
+metadata:
+  name: drivers-system
+  labels:
+    name: drivers-system
+    kyverno.shivering-isles.com/class: "system"
diff --git a/infrastructure/kustomization.yaml b/infrastructure/kustomization.yaml
index 59ab3cb80..169bd6e1d 100644
--- a/infrastructure/kustomization.yaml
+++ b/infrastructure/kustomization.yaml
@@ -3,6 +3,7 @@ kind: Kustomization
 resources:
   - kube-system
   - node-features
+  - drivers
   - system-upgrades
   - firewall
   - metallb
-- 
GitLab