From 65f1c98198da84bb22f53e75357895dea9bd0117 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 1/2] 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 From a478c19ae22c53c90041439f478c5b4a0e329259 Mon Sep 17 00:00:00 2001 From: Yan Bondarenko <202671653+yankawai@users.noreply.github.com> Date: Wed, 21 Oct 2026 13:13:56 +0300 Subject: [PATCH 2/2] test(harbor): check that the resized components reach the release The case that resizes the other components looked only at nginx and the portal, so it would keep passing if those overrides stopped reaching the nested release, and then it could not catch nginx or the portal following another component's values. It now checks the core, registry and jobservice limits it sets and leaves trivy alone, as nothing in the case reads it. The portal case also checks its memory request, as the nginx case does. Assisted-by: LLM Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com> (cherry picked from commit 1d8bea039bf70d2b45fb4d3360fa899ead20ba1f) Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com> --- .../apps/harbor/tests/nginx_resources_test.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/apps/harbor/tests/nginx_resources_test.yaml b/packages/apps/harbor/tests/nginx_resources_test.yaml index bc54d58c7..654615837 100644 --- a/packages/apps/harbor/tests/nginx_resources_test.yaml +++ b/packages/apps/harbor/tests/nginx_resources_test.yaml @@ -41,6 +41,8 @@ tests: - equal: path: spec.values.harbor.portal.resources.limits.cpu value: 500m + - exists: + path: spec.values.harbor.portal.resources.requests.memory - it: keeps both sizes when the other components are resized template: templates/harbor.yaml @@ -56,9 +58,16 @@ tests: memory: 1Gi jobservice: resourcesPreset: t1.medium - trivy: - resourcesPreset: t1.large asserts: + - equal: + path: spec.values.harbor.core.resources.limits.memory + value: 128Mi + - equal: + path: spec.values.harbor.registry.registry.resources.limits.memory + value: 1Gi + - equal: + path: spec.values.harbor.jobservice.resources.limits.memory + value: 1Gi - equal: path: spec.values.harbor.nginx.resources.limits.memory value: 512Mi