Skip to content

Commit eeb989d

Browse files
committed
WIP: Change GPU plugin NFD init container to run-time container
Because: * To work around kustomize inability to enforce correct init container order * This is more likely how things 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 eeb989d

File tree

5 files changed

+27
-10
lines changed

5 files changed

+27
-10
lines changed

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

+11-3
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,24 @@ metadata:
55
spec:
66
template:
77
spec:
8-
initContainers:
9-
- name: intel-gpu-initcontainer
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" ]
1018
volumeMounts:
1119
- name: nfd-features
1220
mountPath: /nfd
1321
readOnly: false
1422
workingDir: /usr/local/bin/gpu-sw
1523
# needed until GPU plugin drops NFD hook usage due to:
1624
# https://github.com/kubernetes-sigs/node-feature-discovery/issues/856
17-
command: ["sh", "-c", "./intel-gpu-nfdhook | tee /nfd/fake-gpu"]
25+
command: ["sh", "-c", "while true; do ./intel-gpu-nfdhook | tee /nfd/fake-gpu; sleep 99999; done"]
1826
volumes:
1927
- name: nfd-features
2028
hostPath:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
name: intel-gpu-plugin
5+
spec:
6+
template:
7+
spec:
8+
initContainers:
9+
- name: intel-gpu-initcontainer
10+
$patch: delete

deployments/gpu_plugin/overlays/fake_devices/fake-device-volumes.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ spec:
1818
readOnly: false
1919
# files are generated under CWD
2020
workingDir: /tmp/fakedev
21-
- name: intel-gpu-initcontainer
21+
containers:
22+
- name: intel-gpu-nfd
2223
# expects sysfs here
2324
volumeMounts:
2425
- name: sysfs
2526
mountPath: /host-sys
2627
readOnly: true
27-
containers:
2828
- name: intel-gpu-plugin
2929
args: [
3030
"-prefix=/tmp/fakedev",

deployments/gpu_plugin/overlays/fake_devices/generate-fake-devices.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
name: fakedev-config
1212
initContainers:
1313
- name: fakedev-generator
14-
image: intel/intel-gpu-fakedev:latest
14+
image: intel/intel-gpu-fakedev:devel
1515
securityContext:
1616
runAsUser: 0
1717
readOnlyRootFilesystem: false
@@ -22,5 +22,3 @@ spec:
2222
readOnly: true
2323
# generate fake sysfs / devfs files for GPU plugin based on config
2424
command: ["/generator", "-json", "/config/fakedev.json", "-verbose"]
25-
# try to make sure generator is (run) before this
26-
- name: intel-gpu-initcontainer

deployments/gpu_plugin/overlays/fake_devices/kustomization.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ configMapGenerator:
99
patches:
1010
- fake-device-volumes.yaml
1111
- generate-fake-devices.yaml
12-
# NFD feature file change is obsolete after GPU plugin moves away from NFD hooks:
12+
# NFD feature file changes is obsolete after GPU plugin moves away from NFD hooks
1313
# https://github.com/kubernetes-sigs/node-feature-discovery/issues/856
14-
- use-nfd-feature-file.yaml
14+
- del-intel-gpu-initcontainer.yaml
15+
- add-nfd-feature-file.yaml

0 commit comments

Comments
 (0)