multus-cni icon indicating copy to clipboard operation
multus-cni copied to clipboard

Enhance CNI flexibility to read and write deviceInfo by removing the deviceID restriction

Open jiayoukun opened this issue 3 months ago • 2 comments

Based on the Device Information Specification described in the provided links [https://github.com/k8snetworkplumbingwg/device-info-spec/] [https://github.com/k8snetworkplumbingwg/device-info-spec/blob/main/SPEC.md]

The NPWG Implementation Requirements necessitate checking the deviceID for creating the "CNIDeviceInfoFile", which lacks flexibility. My understanding is that CNIs should also have read and write permissions for deviceInfo. However, in the current Multus code, if the deviceID is not configured in the NetworkAttachmentDefinition (NAD), the "CNIDeviceInfoFile" is not created and passed to the CNI. I believe this part of the code has limitations.

In the current code, I added a condition for generating the "CNIDeviceInfoFile". As long as Capabilities["CNIDeviceInfoFile"] is configured as true in the NAD, an empty file is generated. This way, the "CNIDeviceInfoFile" can be passed to the CNI, allowing CNIs without a deviceID to participate in reading and writing deviceInfo. All the deviceInfo will eventually be returned to the kubelet.

Furthermore, I plan to extend the Device Information Specification in the future to include more adaptable fields, enhancing its flexibility and accommodating a wider range of scenarios.

jiayoukun avatar May 09 '24 09:05 jiayoukun