You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: design-proposals/network-binding-plugin/network-binding-plugin.md
+115-1Lines changed: 115 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -224,6 +224,56 @@ pod.
224
224
- Mount points
225
225
- Downward API
226
226
227
+
##### Compute Container Resource Overhead
228
+
229
+
For some plugins, an additional resource consumption can be expected from the virt-launcher pod compute container.
230
+
For example, there could be need to execute an additional binary in the compute container.
231
+
Since this binary has its own CPU and memory limits, they should be somehow accounted for.
232
+
Another example could be increased resource consumption of the virt-stack resulting from using the plugin.
233
+
234
+
Suggested solution:
235
+
236
+
Additional API for compute container resource overhead:
237
+
238
+
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:
239
+
240
+
```yaml
241
+
apiVersion: kubevirt.io/v1
242
+
kind: KubeVirt
243
+
metadata:
244
+
name: kubevirt
245
+
namespace: kubevirt
246
+
spec:
247
+
configuration:
248
+
network:
249
+
binding:
250
+
mynetbindingplugin:
251
+
sidecarImage: quay.io/kubevirt/mynetbindingplugin
252
+
computeResourceOverhead:
253
+
requests:
254
+
memory: 200Mi
255
+
```
256
+
257
+
If specified, KubeVirt will add the resource overhead specified in `computeResourceOverhead` to the compute container of the virt-launcher pod.
258
+
The specified resource overhead will be added to the compute container per unique usage of the plugin (not per NIC using the binding).
259
+
260
+
For example, assuming there is a plugin registered with a 200Mi memory overhead for the `compute` container, and
261
+
there are two interfaces using it.
262
+
`virt-controller`will only add 200Mi of memory to the `compute` container.
263
+
264
+
Pros:
265
+
- Cluster-wide definition of compute resource overhead per plugin.
266
+
- Additional resources could be requested other than CPU and memory.
267
+
- The resource overhead specification is visible to cluster admins.
268
+
269
+
Cons:
270
+
- Requires an API change.
271
+
- When upgrading KubeVirt / network binding plugin versions, the compute resource overhea specification might require adjustments.
272
+
273
+
This solution was selected since it provides the cluster admin more control in regard to resource allocation.
274
+
275
+
For the alternative solutions please see [Appendix G](#appendix-g-alternatives-to-compute-container-resource-overhead-specification)
276
+
227
277
#### Configure Pod netns
228
278
229
279
The CNI plugin has privileged access to the pod network namespace and
The binding plugin authors will provide a [mutating webhook](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#mutatingadmissionwebhook) that will intercept
1259
+
virt-launcher pod creation that have the above label, and add the appropriate resources requests/limits
1260
+
for the pod's `compute` container.
1261
+
1262
+
The mutating webhook will be able to identify the plugin's compute container by its name (`compute`) or using the value of
1263
+
the `kubectl.kubernetes.io/default-container` annotation.
1264
+
1265
+
Pros:
1266
+
- Plugin authors have full control over the compute resources
1267
+
- Additional API is not added to KubeVirt.
1268
+
- Opens the door for additional changes to the virt-launcher pod without changes to KubeVirt.
1269
+
- Code changes in KubeVirt are very small.
1270
+
1271
+
Cons:
1272
+
- Plugin authors should provide another component and integrate it.
1273
+
- Additional point of failure.
1274
+
- Requires maintaining certificates for the webhook.
1275
+
- Additional latency when creating VMs with network binding plugins.
1276
+
- The additional resource specification is less visible to cluster admins.
1277
+
- Resource specification could collide with the support container resources specified on the KubeVirt CR or other webhooks.
1278
+
1279
+
The requirement to maintain certificates for the webhook could be mitigated using tools such as [cert-manager](https://cert-manager.io/).
0 commit comments