|
| 1 | +# Sidecar hooks |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +A hooking mechanism that allows customizations to the VMI before it starts without changing KubeVirt |
| 6 | +core components. The common user of those hooks are Sidecars that will run in the same Pod that the |
| 7 | +VMI will be deployed. |
| 8 | + |
| 9 | +## Motivation |
| 10 | + |
| 11 | +A way to accomodate use cases that we might not want to bring and support in KubeVirt itself or to |
| 12 | +give room to test and develop features while they are still not mature enough. |
| 13 | + |
| 14 | +## Goals |
| 15 | + |
| 16 | +- Provide and maintain a set of gRPC APIs for users to do modifications to the VMI |
| 17 | + |
| 18 | +## Non Goals |
| 19 | + |
| 20 | +- Maintain a wide variety of user's applications in KubeVirt codebase |
| 21 | + |
| 22 | +## User Stories |
| 23 | + |
| 24 | +- As a VM owner, I want to apply custom configurations to QEMU command line |
| 25 | + - For debugability, by adding support or tweak [to run with debug tools][] |
| 26 | + - To test unsupported features or apply changes that [could workaround bugs][] |
| 27 | +- As a KubeVirt developer, I want to provide alternative solutions that might not be ready to core |
| 28 | + KubeVirt components |
| 29 | + - For Network configurations like [Slirp][] and [Passt][] |
| 30 | + |
| 31 | +## Design |
| 32 | + |
| 33 | +KubeVirt should provide a versioned gRPC Hook module, with all the APIs that can be used including |
| 34 | +parameters and responses. |
| 35 | + |
| 36 | +The gRPC server runs in the Sidecar. The Sidecars will use the module to establish the communication |
| 37 | +with virt-launcher and exchange capabilities to define which Hook version is being used and what are |
| 38 | +the hooks that are implemented. |
| 39 | + |
| 40 | +Virt-launcher will be entitled with managing the hooks. It'll verify and connect to all the Sidecars |
| 41 | +that are running by checking the pre-defined folder where the unix sockets for gRPC communication |
| 42 | +will be created. |
| 43 | + |
| 44 | +Virt-launcher should apply the requested changeds to the VMI. |
| 45 | + |
| 46 | +## Hooks API promotion |
| 47 | + |
| 48 | +Should follow the same rules as stated in [API Graduation Guidelines][] |
| 49 | + |
| 50 | +[to run with debug tools]: https://kubevirt.io/user-guide/debug_virt_stack/launch-qemu-strace/ |
| 51 | +[could workaround bugs]: https://github.com/kubevirt/kubevirt/issues/8420 |
| 52 | +[Slirp]: https://github.com/kubevirt/kubevirt/pull/10272 |
| 53 | +[Passt]: https://github.com/kubevirt/kubevirt/pull/10425 |
| 54 | +[API Graduation Guidelines]: ../docs/api-graduation-guidelines.md |
0 commit comments