diff --git a/deployments/gpu_plugin/overlays/fake_devices/add-nfd-feature-file.yaml b/deployments/gpu_plugin/overlays/fake_devices/add-nfd-feature-file.yaml new file mode 100644 index 000000000..8c852b070 --- /dev/null +++ b/deployments/gpu_plugin/overlays/fake_devices/add-nfd-feature-file.yaml @@ -0,0 +1,34 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: intel-gpu-plugin +spec: + template: + spec: + containers: + - name: intel-gpu-nfd + # convert generated sysfs content to NFD feature labels file + image: intel/intel-gpu-initcontainer:devel + imagePullPolicy: IfNotPresent + securityContext: + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + capabilities: + drop: [ "ALL" ] + volumeMounts: + - name: sysfs + # expects sysfs here + mountPath: /host-sys + readOnly: true + - name: nfd-features + mountPath: /nfd + readOnly: false + workingDir: /usr/local/bin/gpu-sw + # needed until GPU plugin drops NFD hook usage due to: + # https://github.com/kubernetes-sigs/node-feature-discovery/issues/856 + command: ["sh", "-c", "while true; do ./intel-gpu-nfdhook | tee /nfd/fake-gpu; sleep 99999; done"] + volumes: + - name: nfd-features + hostPath: + path: /etc/kubernetes/node-feature-discovery/features.d/ + type: DirectoryOrCreate diff --git a/deployments/gpu_plugin/overlays/fake_devices/del-intel-gpu-initcontainer.yaml b/deployments/gpu_plugin/overlays/fake_devices/del-intel-gpu-initcontainer.yaml new file mode 100644 index 000000000..2d8c7439d --- /dev/null +++ b/deployments/gpu_plugin/overlays/fake_devices/del-intel-gpu-initcontainer.yaml @@ -0,0 +1,6 @@ +$patch: delete +spec: + template: + spec: + initContainers: + - name: intel-gpu-initcontainer diff --git a/deployments/gpu_plugin/overlays/fake_devices/kustomization.yaml b/deployments/gpu_plugin/overlays/fake_devices/kustomization.yaml index 31044cbce..4541660ff 100644 --- a/deployments/gpu_plugin/overlays/fake_devices/kustomization.yaml +++ b/deployments/gpu_plugin/overlays/fake_devices/kustomization.yaml @@ -6,9 +6,11 @@ configMapGenerator: - name: fakedev-config files: - fakedev-config.json +patchesStrategicMerge: + # NFD feature file change is obsolete after GPU plugin moves away from NFD hooks +- del-intel-gpu-initcontainer.yaml patches: - fake-device-volumes.yaml - generate-fake-devices.yaml - # NFD feature file change is obsolete after GPU plugin moves away from NFD hooks: - # https://github.com/kubernetes-sigs/node-feature-discovery/issues/856 - - use-nfd-feature-file.yaml + # NFD feature file change is obsolete after GPU plugin moves away from NFD hooks + - add-nfd-feature-file.yaml diff --git a/deployments/gpu_plugin/overlays/fake_devices/use-nfd-feature-file.yaml b/deployments/gpu_plugin/overlays/fake_devices/use-nfd-feature-file.yaml deleted file mode 100644 index 508b0bd80..000000000 --- a/deployments/gpu_plugin/overlays/fake_devices/use-nfd-feature-file.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: intel-gpu-plugin -spec: - template: - spec: - initContainers: - - name: intel-gpu-initcontainer - volumeMounts: - - name: nfd-features - mountPath: /nfd - readOnly: false - workingDir: /usr/local/bin/gpu-sw - # needed until GPU plugin drops NFD hook usage due to: - # https://github.com/kubernetes-sigs/node-feature-discovery/issues/856 - command: ["sh", "-c", "./intel-gpu-nfdhook | tee /nfd/fake-gpu"] - volumes: - - name: nfd-features - hostPath: - path: /etc/kubernetes/node-feature-discovery/features.d/ - type: DirectoryOrCreate