Skip to content

Commit

Permalink
WIP: Change GPU plugin NFD init container to run-time container
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
eero-t committed Aug 29, 2022
1 parent e1d6928 commit fa7cfa7
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$patch: delete
spec:
template:
spec:
initContainers:
- name: intel-gpu-initcontainer
Original file line number Diff line number Diff line change
Expand Up @@ -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

This file was deleted.

0 comments on commit fa7cfa7

Please sign in to comment.