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

Adding a proposal for existing hooks sidecar #252

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

Conversation

victortoso
Copy link
Member

Adding a proposal based on @EdDev recommendation [here](kubevirt/kubevirt#10842 (comment).

The goal is to define a clear path for API graduation of the hooks. I'm not sure how much technical detail I should add in the proposal, so feel free to let me know what I have missing.

@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Dec 12, 2023
@kubevirt-bot
Copy link

[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 rmohr 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

design-proposals/sidecar-hooks.md Outdated Show resolved Hide resolved

## Non Goals

- Maintain a wide variety of user's applications in KubeVirt codebase
Copy link

Choose a reason for hiding this comment

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

Maybe expand on the non-goals: What types of user applications are considered "wide variety," and why is it not a goal to maintain them in the KubeVirt codebase?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good point. I think the important factor is core functionalities for KubeVirt that can be helped with sidecars. We do provide and maintain Today sidecars that configure slirp and passt, named "network pluggins".

I think it is reasonable that we improve hooks API as needed for core functionalities like that, but not necessarily to all cases.

If we do have a lot of sidecars with custom features that users want to have in a single place, we should simply create another repository for it. It does not need to be in KubeVirt repo, nor maintained by KubeVirt developers.


## Hooks API promotion

Should follow the same rules as stated in [API Graduation Guidelines][]
Copy link

Choose a reason for hiding this comment

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

nit: missing link to API Graduation Guidelines on Line 48

Copy link
Member Author

Choose a reason for hiding this comment

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

I've used relative path line 54 (last line). It seems to have worked when looking from my personal branch
https://github.com/victortoso/kubevirt-community/blob/hooks-formal-proposal/design-proposals/sidecar-hooks.md

Signed-off-by: Victor Toso <victortoso@redhat.com>
Copy link
Member

@EdDev EdDev left a comment

Choose a reason for hiding this comment

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

Thank you for starting this effort, we are lacking intent and design thoughts on the sidecar hooks.

Recent work on sidecars & hooks exposed challenges on how to evolve the protocol API, keep old sidecars working and a clear view forward about the API stability so it can be trusted.


## Goals

- Provide and maintain a set of gRPC APIs for users to do modifications to the VMI
Copy link
Member

Choose a reason for hiding this comment

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

I think these are too specific, possibly even touching the implementation.

I guess that the main goal is to define a stable integration point for custom programs, that are looking to extend Kubevirt VM functionality.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hum, yes. In the end, it is an interface to make changes. I've changed it to the following:

-- Provide and maintain a set of gRPC APIs for users to do modifications to the VMI
+- Provide and maintain an interface for custom applications to do modifications to the VMI

## Goals

- Provide and maintain a set of gRPC APIs for users to do modifications to the VMI
- Provide and maintain sidecars that are important for core functionalities
Copy link
Member

Choose a reason for hiding this comment

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

I am unsure if this merits a special goal. Both external and internal sidecars are expected to get the same assurance and stability for the integration point.

Copy link
Member Author

@victortoso victortoso Feb 13, 2024

Choose a reason for hiding this comment

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

Right, what you said is true but should be covered by the first bullet. What the second bullet introduces is that, we will provide some sidecars which add functionalities to KubeVirt and those sidecars we will be maintaining.

We might want to take out or not the second bullet. I'm not sure where to draw the line in this document.

- As a VM owner, I want to apply custom configurations to QEMU command line
- For debugability, by adding support or tweak [to run with debug tools][]
- To test unsupported features or apply changes that [could workaround bugs][]
- As a KubeVirt developer, I want to provide alternative solutions that might not be ready to core
Copy link
Member

Choose a reason for hiding this comment

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

We want to provide a modular, plug-able solution, to Kubevirt without overloading the core components.

It is not necessary a matter of readiness.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, do you disagree with it? I thought that network binding plugins was an example of this. Of course, I can be wrong.

that are running by checking the pre-defined folder where the unix sockets for gRPC communication
will be created.

Virt-launcher should apply the requested changes to the VMI.
Copy link
Member

Choose a reason for hiding this comment

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

This is unclear.
I think virt-launcher is suppose to proxy domain creation and changes through the hook point before applying it to the domain manager (libvirt).

Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps I can do a better wording here. What happens is that virt-launcher has an XML ready to be applied, but provides this to the sidecar over hook API. The sidecar apply changes to it. Virt-launcher applies the result XML to libvirt.

Changed to:

-Virt-launcher should apply the requested changes to the VMI.
+Virt-launcher will apply the result data provided by the sidecars and then create the VMI.


Virt-launcher should apply the requested changes to the VMI.

## Hooks API promotion
Copy link
Member

Choose a reason for hiding this comment

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

I think we are missing the API definition with all its details.
There is a need to express all existing versions and describe what each functionality does.

There is also a need to explain what are the implications and considerations of a sidecar author regarding backward and forward compatibility. Perhaps starting with the virt-launcher side, which relates to the Kubevirt support of hooks and what are the expectations from the server side.

It will be useful to elaborate on what happens when Kubevirt upgrades occur and what happens when the sidecar is upgraded.
Migration also needs to be taken into account, to explain the implications.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, I was in doubt about how deep I should go with the details. I'll go a little bit deeper.

@alicefr
Copy link
Member

alicefr commented Jan 25, 2024

@victortoso I think we are missing what happen when we upgrade and migrate virt-launcher pods with sidecars. I'm thinking to the case when we upgrade virt-launcher with a deprecated hooks API. Do we have a mechanism to change the sidecar image on migration? Like, I want to upgrade my sidecar at the same time I upgrade KubeVirt

@victortoso
Copy link
Member Author

Do we have a mechanism to change the sidecar image on migration?

@alicefr there is none. The image is defined on annotation and that's it. That's a great use case.

The problem is that, this and other suggestions are improvements that should likely be implemented for the beta version. Should we define this now in this PR? Perhaps I can add a section of Future improvements? Or we keep it simple with only alpha related APIs / limitations and we update this when we agree on all improvements we want for Beta.

@kubevirt-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@kubevirt-bot kubevirt-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 14, 2024
@victortoso
Copy link
Member Author

/remove-lifecycle stale

I'll get back to this. Its just that there are related ongoing discussions/events around hook sidecars that would merit being added here too.

@kubevirt-bot kubevirt-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 14, 2024
@go-bai
Copy link

go-bai commented May 20, 2024

@victortoso I think that when multiple hook sidecars have the same hook point, we can sort those hook points based on priority to determine the execution order. kubevirt/kubevirt#11941

@iholder101
Copy link
Contributor

/cc

@kubevirt-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@kubevirt-bot kubevirt-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 20, 2024
@victortoso
Copy link
Member Author

/remove-lifecycle stale

Promise to get back to this soon.

@kubevirt-bot kubevirt-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 20, 2024
@kubevirt-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@kubevirt-bot kubevirt-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 18, 2024
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. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants