Skip to content

Commit 7c06345

Browse files
committed
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 <[email protected]>
1 parent 3cd2612 commit 7c06345

1 file changed

Lines changed: 67 additions & 0 deletions

File tree

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
suite: nginx proxy and portal resources
2+
3+
release:
4+
name: harbor
5+
namespace: tenant-test
6+
7+
set:
8+
_namespace:
9+
host: example.org
10+
ingress: nginx
11+
gateway: ""
12+
seaweedfs: seaweedfs
13+
_cluster:
14+
solver: http01
15+
16+
tests:
17+
- it: sizes the nginx proxy with t1.small instead of leaving it to the namespace LimitRange
18+
template: templates/harbor.yaml
19+
documentSelector:
20+
path: kind
21+
value: HelmRelease
22+
asserts:
23+
- equal:
24+
path: spec.values.harbor.nginx.resources.limits.memory
25+
value: 512Mi
26+
- equal:
27+
path: spec.values.harbor.nginx.resources.limits.cpu
28+
value: "1"
29+
- exists:
30+
path: spec.values.harbor.nginx.resources.requests.memory
31+
32+
- it: sizes the portal with t1.micro
33+
template: templates/harbor.yaml
34+
documentSelector:
35+
path: kind
36+
value: HelmRelease
37+
asserts:
38+
- equal:
39+
path: spec.values.harbor.portal.resources.limits.memory
40+
value: 256Mi
41+
- equal:
42+
path: spec.values.harbor.portal.resources.limits.cpu
43+
value: 500m
44+
45+
- it: keeps both sizes when the other components are resized
46+
template: templates/harbor.yaml
47+
documentSelector:
48+
path: kind
49+
value: HelmRelease
50+
set:
51+
core:
52+
resourcesPreset: t1.nano
53+
registry:
54+
resources:
55+
cpu: "2"
56+
memory: 1Gi
57+
jobservice:
58+
resourcesPreset: t1.medium
59+
trivy:
60+
resourcesPreset: t1.large
61+
asserts:
62+
- equal:
63+
path: spec.values.harbor.nginx.resources.limits.memory
64+
value: 512Mi
65+
- equal:
66+
path: spec.values.harbor.portal.resources.limits.memory
67+
value: 256Mi

0 commit comments

Comments
 (0)