Skip to content

Commit

Permalink
Add CDI support for SRIOV Network Device Plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Kolodiazhny <ikolodiazhny@nvidia.com>
  • Loading branch information
e0ne committed Sep 26, 2023
1 parent f0db0a7 commit e7dc330
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
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}}
3 changes: 3 additions & 0 deletions pkg/state/state_shared_dp.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ func (s *stateSharedDp) getManifestObjects(
return nil, err
}

if cr.Spec.RdmaSharedDevicePlugin.UseCdi {
reqLogger.V(consts.LogLevelInfo).Info("useCDI is not supported for RDMA Shared Device plugin in the current version")
}
renderData := &sharedDpManifestRenderData{
CrSpec: cr.Spec.RdmaSharedDevicePlugin,
Tolerations: cr.Spec.Tolerations,
Expand Down

0 comments on commit e7dc330

Please sign in to comment.