From 416926c734c448dd49b0a2c0f1f4beee5649921e Mon Sep 17 00:00:00 2001 From: Orel Misan Date: Sun, 23 Jun 2024 13:44:09 +0300 Subject: [PATCH] Network binding plugin: Address compute container resource overhead Signed-off-by: Orel Misan --- .../network-binding-plugin.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/design-proposals/network-binding-plugin/network-binding-plugin.md b/design-proposals/network-binding-plugin/network-binding-plugin.md index 704185e9..86ff2624 100644 --- a/design-proposals/network-binding-plugin/network-binding-plugin.md +++ b/design-proposals/network-binding-plugin/network-binding-plugin.md @@ -303,6 +303,58 @@ Cons: - Additional point of failure. - Additional latency when creating VMs with network binding plugins. +##### Compute Container Resource Requirements / Limits + +For some plugins, such as passt, there is a need to execute an additional binary in the compute container. +Since this binary has its own CPU and memory limits, they should be somehow accounted for. + +Alternatives: +1. Manually setting the VM's resources: +The user can override KubeVirt's algorithms and set resource requirements. + +Pros: +- Already implemented. + +Cons: +- Error prune +- The user does not take into account the overhead considerations KubeVirt takes when templating a virt-launcher pod. + +2. Additional API for compute container resource overhead: + +The network binding plugin API in the KubeVirt CR could receive an additional input field to specify the resource requirements overhead for the compute container: + +```yaml +apiVersion: kubevirt.io/v1 +kind: KubeVirt +metadata: + name: kubevirt + namespace: kubevirt +spec: + configuration: + network: + binding: + mynetbindingplugin: + sidecarImage: quay.io/kubevirt/mynetbindingplugin + computeContainerResourceOverhead: + requests: + cpu: 200m + memory: 20Mi +``` + +Pros: +- Cluster-wide definition of network binding plugin compute resource overhead per plugin. +- Additional resources could be requested other than CPU and Memory. + +Cons: +- Require an API change. +- The API will probably evolve as additional plugins will be created. +- May require cluster admins to adjust plugin resources during the plugin's lifecycle. + +3. Mutating for the virt-launcher pod: + +Same suggestion as in the sidecar section. + +The webhook will add the required resource overhead for the compute container. #### Configure Pod netns