Skip to content

Commit fa7cfa7

Browse files
committed
WIP: Change GPU plugin NFD init container to run-time container
To work around kustomize inability to enforce correct init container, and because this is more likely way how it will work once NFD drops support for hooks: kubernetes-sigs/node-feature-discovery#856 Signed-off-by: Eero Tamminen <[email protected]>
1 parent e1d6928 commit fa7cfa7

File tree

4 files changed

+45
-25
lines changed

4 files changed

+45
-25
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
name: intel-gpu-plugin
5+
spec:
6+
template:
7+
spec:
8+
containers:
9+
- name: intel-gpu-nfd
10+
# convert generated sysfs content to NFD feature labels file
11+
image: intel/intel-gpu-initcontainer:devel
12+
imagePullPolicy: IfNotPresent
13+
securityContext:
14+
readOnlyRootFilesystem: true
15+
allowPrivilegeEscalation: false
16+
capabilities:
17+
drop: [ "ALL" ]
18+
volumeMounts:
19+
- name: sysfs
20+
# expects sysfs here
21+
mountPath: /host-sys
22+
readOnly: true
23+
- name: nfd-features
24+
mountPath: /nfd
25+
readOnly: false
26+
workingDir: /usr/local/bin/gpu-sw
27+
# needed until GPU plugin drops NFD hook usage due to:
28+
# https://github.com/kubernetes-sigs/node-feature-discovery/issues/856
29+
command: ["sh", "-c", "while true; do ./intel-gpu-nfdhook | tee /nfd/fake-gpu; sleep 99999; done"]
30+
volumes:
31+
- name: nfd-features
32+
hostPath:
33+
path: /etc/kubernetes/node-feature-discovery/features.d/
34+
type: DirectoryOrCreate
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
$patch: delete
2+
spec:
3+
template:
4+
spec:
5+
initContainers:
6+
- name: intel-gpu-initcontainer

deployments/gpu_plugin/overlays/fake_devices/kustomization.yaml

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ configMapGenerator:
66
- name: fakedev-config
77
files:
88
- fakedev-config.json
9+
patchesStrategicMerge:
10+
# NFD feature file change is obsolete after GPU plugin moves away from NFD hooks
11+
- del-intel-gpu-initcontainer.yaml
912
patches:
1013
- fake-device-volumes.yaml
1114
- generate-fake-devices.yaml
12-
# NFD feature file change is obsolete after GPU plugin moves away from NFD hooks:
13-
# https://github.com/kubernetes-sigs/node-feature-discovery/issues/856
14-
- use-nfd-feature-file.yaml
15+
# NFD feature file change is obsolete after GPU plugin moves away from NFD hooks
16+
- add-nfd-feature-file.yaml

deployments/gpu_plugin/overlays/fake_devices/use-nfd-feature-file.yaml

-22
This file was deleted.

0 commit comments

Comments
 (0)