Skip to content
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

sidecar to inject qemu args #11876

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ibrokethecloud
Copy link

What this PR does

Before this PR:
PR introduces an additional sample sidecar to inject additional qemu args to the domain definition, based on annotations present on the VMI.

After this PR:
Users can fine tune qemu args in the domain definition to control specific behavior.

Fixes #
#11093

Why we need it and why it was done in this way

The following tradeoffs were made:
The sidecar approach seems the least disruptive means to perform this operation without changing core kubevirt api to allow inject of random qemu arguments.

The following alternatives were considered:

Links to places where the discussion took place:
Please refer to conversation from here: #11093 (comment)

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


@kubevirt-bot
Copy link
Contributor

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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/test-infra repository.

@kubevirt-bot kubevirt-bot added dco-signoff: no Indicates the PR's author has not DCO signed all their commits. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels May 9, 2024
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot
Copy link
Contributor

Hi @ibrokethecloud. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

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/test-infra repository.

@kubevirt-bot kubevirt-bot added size/L sig/buildsystem Denotes an issue or PR that relates to changes in the build system. labels May 9, 2024
…tions on vmi

Signed-off-by: Gaurav Mehta <gaurav.mehta@suse.com>
@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. and removed dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels May 9, 2024
@victortoso
Copy link
Member

I wrote one in the past too, see #9166 (comment)

Copy link
Member

@victortoso victortoso left a comment

Choose a reason for hiding this comment

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

You might be able to write this in python and attach to a configmap and enable it with annotation, instead of having to build a container image.


vmSchema "kubevirt.io/api/core/v1"

"kubevirt.io/kubevirt/pkg/virt-launcher/virtwrap/api"
Copy link
Member

Choose a reason for hiding this comment

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

If the PR is to be accepted, I'd use libvirtxml instead. This makes the sidecar easy to build out-of-tree. See this one which is not merged yet: #11846

@alicefr
Copy link
Member

alicefr commented May 13, 2024

@ibrokethecloud this should be doable with the configmap that @victortoso mentioned. I would avoid to add an new image. On the other hand, I think we are missing the documentation how to achieve it, @victortoso am I correct? If so, would you mind to add the example in the user guide?

@victortoso
Copy link
Member

Hi @alicefr and @ibrokethecloud

I created a simple python script to add qemu env/args using sidecars + configmap and published it as a gist:
https://gist.github.com/victortoso/4a54ef0e75a2b917bb21cb33ec4da141

would you mind to add the example in the user guide?

I'll propose adding it in the user-guide later Today.

Just for clarification, the steps using this example are:

  1. The annotation for env/args is: libvirt.vm.kubevirt.io/qemuArgs, see how the data was set here
  2. Create the configmap e.g: k create -f examples/my-config-map.yaml
  3. Create the VMI (should have sidecar metadata properly set, see it here)

Cheers,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. sig/buildsystem Denotes an issue or PR that relates to changes in the build system. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants