Skip to content

Commit

Permalink
Switch Intel plugin pod to use faked devices
Browse files Browse the repository at this point in the history
Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
  • Loading branch information
eero-t committed Aug 19, 2022
1 parent 3c86f24 commit 1b00a30
Showing 1 changed file with 44 additions and 12 deletions.
56 changes: 44 additions & 12 deletions cmd/gpu_plugin/fakedev/intel-gpu-plugin-fake.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,61 +16,93 @@ spec:
spec:
serviceAccountName: resource-reader-sa
initContainers:
- name: fakedev-generator
image: intel/fakedev-generator:latest
securityContext:
runAsUser: 0
readOnlyRootFilesystem: false
allowPrivilegeEscalation: false
# files are generated under CWD
workingDir: /tmp/fakedev
volumeMounts:
- name: devfs
mountPath: /tmp/fakedev/dev
readOnly: false
- name: sysfs
mountPath: /tmp/fakedev/sys
readOnly: false
- name: fake-conf
mountPath: /config
readOnly: true
# generate fake sysfs / devfs files for GPU plugin based on config
command: ["/generator", "-json", "/config/fakedev.json", "-verbose"]
- name: intel-gpu-initcontainer
image: intel/intel-gpu-initcontainer:0.24.0
imagePullPolicy: IfNotPresent
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
volumeMounts:
- mountPath: /etc/kubernetes/node-feature-discovery/source.d/
name: nfd-source-hooks
- name: sysfs
mountPath: /host-sys
readOnly: true
- name: nfd-features
mountPath: /nfd
readOnly: false
workingDir: /usr/local/bin/gpu-sw
# convert generated sysfs content to NFD feature labels
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:0.24.0
imagePullPolicy: IfNotPresent
image: intel/intel-gpu-plugin:latest
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
command: [
"/usr/local/bin/intel_gpu_device_plugin",
"-shared-dev-num", "300",
"-shared-dev-num", "2",
"-fake-mode", "/tmp/fakedev,",
"-enable-monitoring",
"-resource-manager",
"-v", "2"
]
volumeMounts:
# combined GPU plugin / container runtime limitation:
# device files need to be mounted to same path on host and inside container
- name: devfs
mountPath: /dev/dri
mountPath: /tmp/fakedev/dev
readOnly: true
- name: sysfs
mountPath: /sys/class/drm
mountPath: /tmp/fakedev/sys
readOnly: true
- name: kubeletsockets
mountPath: /var/lib/kubelet/device-plugins
- name: podresources
mountPath: /var/lib/kubelet/pod-resources
volumes:
- name: fake-conf
configMap:
name: fake-gen-config
- name: devfs
hostPath:
path: /dev/dri
path: /tmp/fakedev/dev
type: DirectoryOrCreate
- name: sysfs
hostPath:
path: /sys/class/drm
emptyDir: {}
- name: kubeletsockets
hostPath:
path: /var/lib/kubelet/device-plugins
- name: podresources
hostPath:
path: /var/lib/kubelet/pod-resources
- name: nfd-source-hooks
- name: nfd-features
hostPath:
path: /etc/kubernetes/node-feature-discovery/source.d/
path: /etc/kubernetes/node-feature-discovery/features.d/
type: DirectoryOrCreate
nodeSelector:
kubernetes.io/arch: amd64

0 comments on commit 1b00a30

Please sign in to comment.