Add Support for CDI Devices in Container Creation #522
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
The Kubernetes CRI (Container Runtime Interface)
ContainerConfigAPI supports CDI (Container Device Interface) devices, and Docker Engine v25.0.0+ supports CDI devices (see Docker v25.0.0 release notes, and related PR). As an adapter between Docker and Kubelet, cri-dockerd was not passing CDI devices of the CRIContainerConfigfrom Kubelet to Docker during container creation.Changes
This PR adds support for CDI devices by:
ContainerConfigin CreateContainerDeviceRequest(Reference format for Docker DeviceRequest: https://github.com/moby/moby/pull/45134/files#diff-cd251cf1f490eeb3e90d4c15de4c983a7efad7110722baac314731de62cb0957R244).This enables full CDI device support in cri-dockerd, allowing Kubernetes workloads to use CDI devices when running on Docker via cri-dockerd.