From 33f4e93e109b30e0c32c87302addac0dd1a17228 Mon Sep 17 00:00:00 2001 From: Yan Bondarenko <202671653+yankawai@users.noreply.github.com> Date: Wed, 21 Oct 2026 12:56:07 +0300 Subject: [PATCH] test(harbor): pin the resources of the nginx proxy and the portal Both containers run nginx with worker_processes auto, so their idle memory follows the CPU count of the node, whatever their own CPU limit is. In a tenant namespace a container without resources gets the LimitRange default of 128Mi, which the proxy outgrows on a node with many CPUs before it serves a request. The presets that keep both out of that default have no test, so dropping them or tying them to another component's values would go unnoticed. Assisted-by: LLM Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com> (cherry picked from commit 7c0634586bbc5e28dfa431a15d19c77104a00504) Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com> --- .../harbor/tests/nginx_resources_test.yaml | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 packages/apps/harbor/tests/nginx_resources_test.yaml diff --git a/packages/apps/harbor/tests/nginx_resources_test.yaml b/packages/apps/harbor/tests/nginx_resources_test.yaml new file mode 100644 index 000000000..bc54d58c7 --- /dev/null +++ b/packages/apps/harbor/tests/nginx_resources_test.yaml @@ -0,0 +1,67 @@ +suite: nginx proxy and portal resources + +release: + name: harbor + namespace: tenant-test + +set: + _namespace: + host: example.org + ingress: nginx + gateway: "" + seaweedfs: seaweedfs + _cluster: + solver: http01 + +tests: + - it: sizes the nginx proxy with t1.small instead of leaving it to the namespace LimitRange + template: templates/harbor.yaml + documentSelector: + path: kind + value: HelmRelease + asserts: + - equal: + path: spec.values.harbor.nginx.resources.limits.memory + value: 512Mi + - equal: + path: spec.values.harbor.nginx.resources.limits.cpu + value: "1" + - exists: + path: spec.values.harbor.nginx.resources.requests.memory + + - it: sizes the portal with t1.micro + template: templates/harbor.yaml + documentSelector: + path: kind + value: HelmRelease + asserts: + - equal: + path: spec.values.harbor.portal.resources.limits.memory + value: 256Mi + - equal: + path: spec.values.harbor.portal.resources.limits.cpu + value: 500m + + - it: keeps both sizes when the other components are resized + template: templates/harbor.yaml + documentSelector: + path: kind + value: HelmRelease + set: + core: + resourcesPreset: t1.nano + registry: + resources: + cpu: "2" + memory: 1Gi + jobservice: + resourcesPreset: t1.medium + trivy: + resourcesPreset: t1.large + asserts: + - equal: + path: spec.values.harbor.nginx.resources.limits.memory + value: 512Mi + - equal: + path: spec.values.harbor.portal.resources.limits.memory + value: 256Mi