forked from intel/intel-device-plugins-for-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Use intel-gpu-plugin with intel-gpu-fakedev generated devices
TODO: Adding new kustomization (base) directory for this is alternative for kustomizing existing gpu_plugin/ base. It's needed until there's a way for overlay to specify which GPU plugin initcontainer gets run first. Signed-off-by: Eero Tamminen <[email protected]>
- Loading branch information
Showing
4 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"Info": "8x 4 GiB DG1 [Iris Xe MAX Graphics] GPUs", | ||
"DevCount": 8, | ||
"DevMemSize": 4294967296, | ||
"Capabilities": { | ||
"platform": "fake_DG1", | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: intel-gpu-plugin-fake | ||
labels: | ||
app: intel-gpu-plugin-fake | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: intel-gpu-plugin-fake | ||
template: | ||
metadata: | ||
labels: | ||
app: intel-gpu-plugin-fake | ||
spec: | ||
initContainers: | ||
- name: fakedev-generator | ||
image: intel/intel-gpu-fakedev:devel | ||
imagePullPolicy: IfNotPresent | ||
securityContext: | ||
readOnlyRootFilesystem: false | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: [ "ALL" ] | ||
add: [ "MKNOD" ] | ||
# container runtime prevents writing to /sys & /dev, | ||
# so volumes need to be mounted elsewhere | ||
volumeMounts: | ||
- name: devfs | ||
mountPath: /tmp/fakedev/dev | ||
readOnly: false | ||
- name: sysfs | ||
mountPath: /tmp/fakedev/sys | ||
readOnly: false | ||
- name: fake-conf | ||
mountPath: /config | ||
readOnly: true | ||
# files are generated under CWD | ||
workingDir: /tmp/fakedev | ||
# generate fake sysfs / devfs files for GPU plugin based on config | ||
command: ["/generator", "-json", "/config/fakedev.json", "-verbose"] | ||
- name: intel-gpu-initcontainer | ||
# 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" ] | ||
# expects sysfs here | ||
volumeMounts: | ||
- name: sysfs | ||
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", "./intel-gpu-nfdhook | tee /nfd/fake-gpu"] | ||
containers: | ||
- name: intel-gpu-plugin | ||
env: | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
image: intel/intel-gpu-plugin:devel | ||
imagePullPolicy: IfNotPresent | ||
securityContext: | ||
readOnlyRootFilesystem: true | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: [ "ALL" ] | ||
args: [ "-prefix=/tmp/fakedev" ] | ||
# devfs host & container paths must match for everything to work | ||
volumeMounts: | ||
- name: devfs | ||
mountPath: /tmp/fakedev/dev | ||
readOnly: true | ||
- name: sysfs | ||
mountPath: /tmp/fakedev/sys | ||
readOnly: true | ||
- name: kubeletsockets | ||
mountPath: /var/lib/kubelet/device-plugins | ||
volumes: | ||
- name: devfs | ||
hostPath: | ||
path: /tmp/fakedev/dev | ||
type: DirectoryOrCreate | ||
- name: sysfs | ||
hostPath: | ||
emptyDir: {} | ||
- name: fake-conf | ||
configMap: | ||
name: fakedev-config | ||
- name: kubeletsockets | ||
hostPath: | ||
path: /var/lib/kubelet/device-plugins | ||
- name: nfd-features | ||
hostPath: | ||
path: /etc/kubernetes/node-feature-discovery/features.d/ | ||
type: DirectoryOrCreate | ||
nodeSelector: | ||
kubernetes.io/arch: amd64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
configMapGenerator: | ||
- name: fakedev-config | ||
files: | ||
- fakedev-config.json | ||
resources: | ||
- intel-gpu-plugin.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bases: | ||
- base |