Skip to content

Commit

Permalink
Merge pull request #565 from e0ne/sriov-cdi
Browse files Browse the repository at this point in the history
Add CDI support for SRIOV Network Device Plugin
  • Loading branch information
e0ne committed Sep 27, 2023
2 parents f0db0a7 + e27b289 commit 177422c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ spec:
- name: devs
mountPath: /dev/
{{- if .CrSpec.UseCdi }}
- name: default-cdi
mountPath: /etc/cdi/
- name: dynamic-cdi
mountPath: /var/run/cdi
- name: host-config-volume
Expand All @@ -97,10 +95,6 @@ spec:
hostPath:
path: /dev/
{{- if .CrSpec.UseCdi }}
- name: default-cdi
hostPath:
path: /etc/cdi
type: DirectoryOrCreate
- name: dynamic-cdi
hostPath:
path: /var/run/cdi
Expand Down
22 changes: 20 additions & 2 deletions manifests/state-sriov-device-plugin/0030-sriov-dp-daemonset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,24 @@ spec:
- name: {{ . }}
{{- end }}
{{- end }}
{{if .DeployInitContainer}}
{{- if .DeployInitContainer}}
initContainers:
- name: ofed-driver-validation
image: {{ .CrSpec.ImageSpec.Repository }}/{{ .CrSpec.ImageSpec.Image }}:{{ .CrSpec.ImageSpec.Version }}
imagePullPolicy: IfNotPresent
command: ['sh', '-c']
args: ["until lsmod | grep mlx5_core; do echo waiting for OFED drivers to be loaded; sleep 30; done"]
{{end}}
{{- end}}
containers:
- name: kube-sriovdp
image: {{ .CrSpec.ImageSpec.Repository }}/{{ .CrSpec.ImageSpec.Image }}:{{ .CrSpec.ImageSpec.Version }}
imagePullPolicy: IfNotPresent
args:
- --log-dir=sriovdp
- --log-level=10
{{- if .CrSpec.UseCdi}}
- --use-cdi
{{- end}}
securityContext:
privileged: true
volumeMounts:
Expand All @@ -84,6 +87,12 @@ spec:
mountPath: /etc/pcidp
- name: device-info
mountPath: /var/run/k8s.cni.cncf.io/devinfo/dp
{{- if .CrSpec.UseCdi}}
- name: dynamic-cdi
mountPath: /var/run/cdi
- name: host-config-volume
mountPath: /host/etc/pcidp/
{{- end}}
volumes:
- name: devicesock
hostPath:
Expand All @@ -104,3 +113,12 @@ spec:
items:
- key: config.json
path: config.json
{{- if .CrSpec.UseCdi}}
hostPath:
path: /var/run/cdi
type: DirectoryOrCreate
- name: host-config-volume
hostPath:
path: /etc/pcidp
type: DirectoryOrCreate
{{- end}}

0 comments on commit 177422c

Please sign in to comment.