From 875a24dd259d650e0fec8348d57c6a7201ba86d7 Mon Sep 17 00:00:00 2001 From: Aleksei Sviridkin Date: Thu, 25 Jun 2026 02:38:05 +0300 Subject: [PATCH] fix(kubeovn): raise ovs-ovn CPU limit to give ovn-controller headroom ovn-controller runs inside the ovs-ovn DaemonSet's openvswitch container, sharing it with ovsdb-server and ovs-vswitchd. It is CPU-bound while programming OpenFlow for newly created logical ports. Under a burst install (many pods created at once) it competes for CPU in that single container and CFS-throttles against the 2-core limit, lengthening flow-programming lag that leaves freshly created pods unreachable from their node until the flows land. Raise the ovs-ovn CPU limit from 2 to 4 cores to give ovn-controller headroom to program flows promptly under burst, and lift the CPU request from 10m to 100m so it keeps a guaranteed share under node CPU contention. Memory is left unchanged. Add a helm-unittest guard pinning the new CPU limit and request. Assisted-By: Claude Signed-off-by: Aleksei Sviridkin --- packages/system/kubeovn/Makefile | 3 ++ .../kubeovn/tests/ovs-ovn-resources_test.yaml | 37 +++++++++++++++++++ packages/system/kubeovn/values.yaml | 11 +++++- 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 packages/system/kubeovn/tests/ovs-ovn-resources_test.yaml diff --git a/packages/system/kubeovn/Makefile b/packages/system/kubeovn/Makefile index 456290423..ae297527e 100644 --- a/packages/system/kubeovn/Makefile +++ b/packages/system/kubeovn/Makefile @@ -4,6 +4,9 @@ export NAMESPACE=cozy-$(NAME) include ../../../hack/common-envs.mk include ../../../hack/package.mk +test: + helm unittest . + update: rm -rf charts values.yaml Chart.yaml tag=$$(git ls-remote --tags --sort="v:refname" https://github.com/cozystack/kubeovn-chart | awk -F'[/^]' 'END{print $$3}') && \ diff --git a/packages/system/kubeovn/tests/ovs-ovn-resources_test.yaml b/packages/system/kubeovn/tests/ovs-ovn-resources_test.yaml new file mode 100644 index 000000000..151cacaa4 --- /dev/null +++ b/packages/system/kubeovn/tests/ovs-ovn-resources_test.yaml @@ -0,0 +1,37 @@ +suite: ovs-ovn container CPU resources + +# Pins the CPU headroom this package gives the ovs-ovn DaemonSet container. +# ovn-controller runs inside that one container (alongside ovsdb-server and +# ovs-vswitchd) and is CPU-bound while programming OpenFlow for newly created +# logical ports; under a burst install it CFS-throttles against the container +# CPU limit, lengthening flow-programming lag. The limit must stay at 4 cores +# (not the upstream/legacy 2) and the request must keep a guaranteed share so +# the controller keeps up under contention. + +templates: + - charts/kube-ovn/templates/ovsovn-ds.yaml + +release: + name: kubeovn + namespace: cozy-kubeovn + +tests: + - it: ovs-ovn container carries the raised CPU limit and a guaranteed request + asserts: + - isKind: + of: DaemonSet + - equal: + path: spec.template.spec.containers[0].name + value: openvswitch + - equal: + path: spec.template.spec.containers[0].resources.limits.cpu + value: 4 + - equal: + path: spec.template.spec.containers[0].resources.requests.cpu + value: 100m + + - it: ovs-ovn CPU limit is not the throttle-prone 2 cores + asserts: + - notEqual: + path: spec.template.spec.containers[0].resources.limits.cpu + value: 2 diff --git a/packages/system/kubeovn/values.yaml b/packages/system/kubeovn/values.yaml index e9d2d10f2..ec5e3da3e 100644 --- a/packages/system/kubeovn/values.yaml +++ b/packages/system/kubeovn/values.yaml @@ -25,11 +25,18 @@ kube-ovn: cpu: "3" memory: "4Gi" ovs-ovn: + # ovn-controller runs inside this container (alongside ovsdb-server and + # ovs-vswitchd) and is CPU-bound while programming OpenFlow for newly + # created logical ports. During a burst install (many pods created at + # once) it competes for CPU in this one container; too tight a limit makes + # it CFS-throttle, lengthening flow-programming lag that leaves fresh pods + # unreachable from their node until the flows land. Give it CPU headroom + # (limit) plus a guaranteed share (request) so it keeps up under burst. requests: - cpu: "10m" + cpu: "100m" memory: "50Mi" limits: - cpu: "2" + cpu: "4" memory: "1000Mi" kube-ovn-controller: requests: