feat: add configurable binding conditions support#199
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ttsuuubasa The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| ... | ||
| ``` | ||
|
|
||
| 4. **Set the binding condition**: In a real driver, an external controller or other component would update the `ResourceClaim` status to signal that the device is ready. In this demo, simulate that by editing the status directly. First get the current timestamp in UTC: |
There was a problem hiding this comment.
The example driver should be applying the condition itself instead of relying on users to do this. This better reflects how the feature is implemented and used with real drivers. The example driver doesn't have to wait for anything interesting before applying the condition, but we should include a comment saying where a real driver would wait for some real signal before adding the condition.
There was a problem hiding this comment.
Given the nature of the BindingConditions feature, I believe that we need to implement a controller on the example driver side to handle this. Is my understanding correct?
There was a problem hiding this comment.
Yes, the example driver doesn't run any controller currently. Ideally we set it up to be fairly generic to accommodate other features too, e.g. #71.
There was a problem hiding this comment.
@nojnhuh
I have added an implementation of a controller for setting BindingConditions. To ensure generality, each piece of logic is designed to be implemented as a plugin, allowing the corresponding processing to be executed by implementing its own plugin.
|
|
||
| This demonstration shows the end-to-end flow of the DRA AdminAccess feature. In a production environment, drivers could use this admin access indication to provide additional privileged capabilities or information to authorized workloads. | ||
|
|
||
| ### Demo DRA Device Binding Conditions Feature |
There was a problem hiding this comment.
Can we start putting feature-specific docs in their own directory? I think this would fit somewhere like demo/binding-conditions/README.md.
There was a problem hiding this comment.
I’m planning to create a new directory and move the content currently documented in the README there.
There was a problem hiding this comment.
@nojnhuh
The feature-specific docs for the Binding Conditions demo have been moved under demo/binding-conditions.
There was a problem hiding this comment.
Instead of a script like this, could we add validation to the e2e tests? If we update the driver to add the condition, I think all an e2e test would need to check is that the binding conditions are added to the devices in the ResourceSlices and that the Pods still become Ready and Running. We can assume that Kubernetes is behaving correctly otherwise.
There was a problem hiding this comment.
I’m trying to implement this in the e2e tests instead of using the current script.
There was a problem hiding this comment.
I have added an e2e test that verifies whether binding conditions are set on the ResourceSlice and that the Pod reaches the Running state after the controller sets the binding conditions.
Add --enable-binding-conditions flag and GPU profile support for binding conditions processing in DRA driver. Signed-off-by: Tsubasa Watanabe <w.tsubasa@fujitsu.com>
9c9be6b to
eb2e2d9
Compare
- Add dra-example-controller that automatically satisfies device binding conditions on allocated ResourceClaims using controller-runtime - Add Helm templates, Dockerfile, and RBAC for the controller deployment - Add e2e tests gated by BINDING_CONDITIONS=true to verify ResourceSlice fields and pod readiness Signed-off-by: Tsubasa Watanabe <w.tsubasa@fujitsu.com>
eb2e2d9 to
6d7d13d
Compare
- Change from sequential to parallel plugin execution using goroutines - Collect all plugin errors instead of failing on first error Signed-off-by: Tsubasa Watanabe <w.tsubasa@fujitsu.com>
Summary
Add configurable Binding Conditions support to the DRA example driver, allowing the scheduler to defer final device binding decisions until the driver confirms device readiness on the node.
Motivation
The DRA example driver serves as a reference implementation for developers building their own DRA drivers. By demonstrating how to implement Binding Conditions — including the required ResourceSlice fields and end-to-end demo scripts — this PR helps driver developers understand the expected behavior and integration patterns for this feature introduced in Kubernetes 1.34.
Changes
Kubelet Plugin
--binding-conditionsCLI flag (env:BINDING_CONDITIONS, default:false).BindingConditionsandBindingFailureConditionson each device in the ResourceSlice.kubeletPlugin.bindingConditions: falseto values.yaml and wire it to the kubelet plugin container env in kubeletplugin.yaml.DRADeviceBindingConditionsfeature gate.Controller & E2E Tests
controller.plugins).BINDING_CONDITIONS=true; verify ResourceSlice fields and pod readiness lifecycle.Testing
Requirements
DRADeviceBindingConditions=true