-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for ResourceClaim in HostDevices #12533
base: main
Are you sure you want to change the base?
Conversation
This patch introduces the ResourceClaim for HostDevices and also adds the 'DynamicResourceAllocation' feature gate, which must be enabled to utilize ResourceClaim. After the DRA driver for host devices is configured and deployed , the user needs to add the ClaimParameters and ResourceClaim or ResourceClaimTemplate by following a configuration similar to this : ClaimParameters ----- apiVersion: pci.resource.kubevirt.io/v1alpha1 kind: PciClaimParameters metadata: name: nvme-params namespace: pci-nvme-test1 spec: count: 1 deviceName: "devices.kubevirt.io/nvme" ResourceClaim ----- apiVersion: resource.k8s.io/v1alpha2 kind: ResourceClaim metadata: namespace: pci-nvme-test1 name: test-pci-claim spec: resourceClassName: pci.kubevirt.io parametersRef: apiGroup: pci.resource.kubevirt.io kind: PciClaimParameters name: nvme-params Note: the above information is specific to how DRA driver is configured The user that wants to create a VM with said USB device can do so with the following configuration: In a VMI -------- spec: domain: devices: hostDevices: - name: nvme1 deviceName: devices.kubevirt.io/nvme # <- same as ClaimParameters resourceClaim: name: pci-test source: resourceClaimName: test-pci-claim Signed-off-by: TheRealSibasishBehera <fangedhamster3114@gmail.com>
…er pod Signed-off-by: TheRealSibasishBehera <fangedhamster3114@gmail.com>
Hi @TheRealSibasishBehera. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cc |
/cc @alicefr @victortoso |
@TheRealSibasishBehera please remove the last merge commit |
@@ -0,0 +1,61 @@ | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The examples are generated from code. So, this fine to give an example, but it will be removed by the automatic tooling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see . Is the code generation tool part of kubevirt ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
What this PR does
Before this PR:
virt-handler (which uses device plugin framework) is used to allocate PCI devices to the VM .
User needed to configure the KubeVirtCR and add the device name in the VM manifest as mentioned in
nvme-pci-passthrough
After this PR:
DRA framerwork , along with a separate DRA driver which supports PCI devices , would be used for allocating and managing PCI host devices .
Users would have a option to use
ResourceClaim
for their host devices by enabling "DynamicResourceAllocation" feature gate .Fixes #
Why we need it and why it was done in this way
The following tradeoffs were made:
The following alternatives were considered:
Links to places where the discussion took place:
kubevirt/community#254
Special notes for your reviewer
Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
Release note