Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CDI support for SRIOV Network Device Plugin #565

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}}