k8snetworkplumbingwg / multus-cni

A CNI meta-plugin for multi-homed pods in Kubernetes
Apache License 2.0
2.32k stars 582 forks source link

[WIP] Ensure deviceID is set when a resource is requested #1311

Closed vasrem closed 1 month ago

vasrem commented 1 month ago

If a NAD has the resourceName annotation set, then it means that the subsequent CNI calls should provide the deviceID for that particular resource.

Previously, we were doing best effort to get the deviceID from kubelet. With this patch, we guarantee the deviceID will be passed in the CNI call and fail if we can't find any deviceID.

coveralls commented 1 month ago

Coverage Status

coverage: 63.339% (+0.2%) from 63.116% when pulling 06f0fd883c3d6b721019963e79415df54bd45fda on vasrem:bugfix/ensure-resource-is-passed into 41013e7580396629a02213019baad1d0c84a6a2c on k8snetworkplumbingwg:master.

vasrem commented 1 month ago

Closing this PR as this bugfix breaks the DRA integration. To support the DRA integration, we have to switch the e2e test to use Immediate allocation which is not supported by the dra-example https://github.com/kubernetes-sigs/dra-example-driver/blob/classic-dra/cmd/dra-example-controller/driver.go#L108-L110.

On a similar note, DRA API for 1.31 Kubernetes will change, so the plan is to:

  1. Update the current e2e test to target the "classic dra" which is supported until Kubernetes 1.30 Done in https://github.com/k8snetworkplumbingwg/multus-cni/pull/1313
  2. Adjust the multus integration for 1.31 DRA when 1.31 is released
  3. Re-open this PR to ensure the bug is fixed.