Skip to content

Add support for featureGates#220

Open
Sreeja1725 wants to merge 1 commit into
kubernetes-sigs:mainfrom
Sreeja1725:add-feature-gate-support
Open

Add support for featureGates#220
Sreeja1725 wants to merge 1 commit into
kubernetes-sigs:mainfrom
Sreeja1725:add-feature-gate-support

Conversation

@Sreeja1725

@Sreeja1725 Sreeja1725 commented Jun 11, 2026

Copy link
Copy Markdown

Adds a shared feature gate support and uses VFIOGPUEnabled to select the active driver profile at runtime.

Signed-off-by: svarnam <svarnam@nvidia.com>
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Sreeja1725
Once this PR has been reviewed and has the lgtm label, please assign bart0sh for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from elezar and klueska June 11, 2026 18:13
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 11, 2026
// VFIOGPUEnabled enables PCI passthrough device discovery and preparation via
// the vfio-gpu profile. When enabled, the driver selects that profile
// instead of the default gpu profile.
VFIOGPUEnabled featuregate.Feature = "VFIOGPUEnabled"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is bleeding in from the other PR? Should this be left out?

@alaypatel07 alaypatel07 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding feature gate is a good feature for the example driver, it will help everyone follow the good practices.

Please have a very tight scoped change of introducing the feature gate package. You can leave an example feature gate in comment for documentation and remove vfio traces from this PR

Destination: &flags.healthcheckPort,
EnvVars: []string{"HEALTHCHECK_PORT"},
},
&cli.StringFlag{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can keep this flag right?

we should document with vfio that the profile will be changed to vfio automatically

@alaypatel07

Copy link
Copy Markdown

cc @nojnhuh @pohly

@nojnhuh

nojnhuh commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

I think we've mostly decided against the "feature gate" form factor in #91. Device profiles, command line flags, and Helm values should be enough to enable/disable certain features.

@alaypatel07

Copy link
Copy Markdown

@nojnhuh @pohly we have a community dra driver that uses feature gates: https://github.com/kubernetes-sigs/dra-driver-nvidia-gpu/tree/main/pkg/featuregates

The example dra driver is supposed to be an example of how to implement the dra driver. For features like vfio driver and enabling discoverable metadata, KEP-5304, the dra-driver-nvidia-gpu uses feature gates.

Is there any value in aligning both of them either to profile or feature-gate?

My main reason for having feature gates was because inspired from the DRA Driver for NVIDIA GPUs.

@nojnhuh

nojnhuh commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

The mechanism to toggle features isn't an integral part of how DRA drivers should be implemented IMO. It's ok if different drivers do that in different ways. If anything, the example driver and the NVIDIA driver doing different things can help reinforce that and empower other drivers to do what works for them.

@pohly

pohly commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

I agree with @nojnhuh. The example driver has to support different "personas". I think profiles work well for that. A production driver may only have a single persona. Then boolean flags to toggle something can make sense. Those don't have to be feature gates, a plain boolean flag or config option can be better choice because those can be associated with a dedicated help text.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 16, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@pohly pohly moved this from 🆕 New to 👀 In review in Dynamic Resource Allocation Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants