Skip to content

Commit 767a985

Browse files
committed
Update scale nfr test
1 parent fceb9f9 commit 767a985

File tree

7 files changed

+140
-198
lines changed

7 files changed

+140
-198
lines changed

charts/nginx-gateway-fabric/values.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,19 +372,19 @@ nginx:
372372
# -- The termination grace period of the NGINX data plane pod.
373373
# terminationGracePeriodSeconds: 30
374374

375-
# -- Tolerations for the NGINX Gateway Fabric control plane pod.
375+
# -- Tolerations for the NGINX data plane pod.
376376
# tolerations: []
377377

378-
# -- The nodeSelector of the NGINX Gateway Fabric control plane pod.
378+
# -- The nodeSelector of the NGINX data plane pod.
379379
# nodeSelector: {}
380380

381-
# -- The affinity of the NGINX Gateway Fabric control plane pod.
381+
# -- The affinity of the NGINX data plane pod.
382382
# affinity: {}
383383

384-
# -- The topology spread constraints for the NGINX Gateway Fabric control plane pod.
384+
# -- The topology spread constraints for the NGINX data plane pod.
385385
# topologySpreadConstraints: []
386386

387-
# -- extraVolumes for the NGINX Gateway Fabric control plane pod. Use in conjunction with
387+
# -- extraVolumes for the NGINX data plane pod. Use in conjunction with
388388
# nginx.container.extraVolumeMounts mount additional volumes to the container.
389389
# extraVolumes: []
390390

tests/framework/prometheus.go

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -302,119 +302,6 @@ type Bucket struct {
302302
Val int
303303
}
304304

305-
// GetReloadCount gets the total number of nginx reloads.
306-
func GetReloadCount(promInstance PrometheusInstance, ngfPodName string) (float64, error) {
307-
return getFirstValueOfVector(
308-
fmt.Sprintf(
309-
`nginx_gateway_fabric_nginx_reloads_total{pod="%[1]s"}`,
310-
ngfPodName,
311-
),
312-
promInstance,
313-
)
314-
}
315-
316-
// GetReloadCountWithStartTime gets the total number of nginx reloads from a start time to the current time.
317-
func GetReloadCountWithStartTime(
318-
promInstance PrometheusInstance,
319-
ngfPodName string,
320-
startTime time.Time,
321-
) (float64, error) {
322-
return getFirstValueOfVector(
323-
fmt.Sprintf(
324-
`nginx_gateway_fabric_nginx_reloads_total{pod="%[1]s"}`+
325-
` - `+
326-
`nginx_gateway_fabric_nginx_reloads_total{pod="%[1]s"} @ %d`,
327-
ngfPodName,
328-
startTime.Unix(),
329-
),
330-
promInstance,
331-
)
332-
}
333-
334-
// GetReloadErrsCountWithStartTime gets the total number of nginx reload errors from a start time to the current time.
335-
func GetReloadErrsCountWithStartTime(
336-
promInstance PrometheusInstance,
337-
ngfPodName string,
338-
startTime time.Time,
339-
) (float64, error) {
340-
return getFirstValueOfVector(
341-
fmt.Sprintf(
342-
`nginx_gateway_fabric_nginx_reload_errors_total{pod="%[1]s"}`+
343-
` - `+
344-
`nginx_gateway_fabric_nginx_reload_errors_total{pod="%[1]s"} @ %d`,
345-
ngfPodName,
346-
startTime.Unix(),
347-
),
348-
promInstance,
349-
)
350-
}
351-
352-
// GetReloadAvgTime gets the average time in milliseconds for nginx to reload.
353-
func GetReloadAvgTime(promInstance PrometheusInstance, ngfPodName string) (float64, error) {
354-
return getFirstValueOfVector(
355-
fmt.Sprintf(
356-
`nginx_gateway_fabric_nginx_reloads_milliseconds_sum{pod="%[1]s"}`+
357-
` / `+
358-
`nginx_gateway_fabric_nginx_reloads_total{pod="%[1]s"}`,
359-
ngfPodName,
360-
),
361-
promInstance,
362-
)
363-
}
364-
365-
// GetReloadAvgTimeWithStartTime gets the average time in milliseconds for nginx to reload using a start time
366-
// to the current time to calculate.
367-
func GetReloadAvgTimeWithStartTime(
368-
promInstance PrometheusInstance,
369-
ngfPodName string,
370-
startTime time.Time,
371-
) (float64, error) {
372-
return getFirstValueOfVector(
373-
fmt.Sprintf(
374-
`(nginx_gateway_fabric_nginx_reloads_milliseconds_sum{pod="%[1]s"}`+
375-
` - `+
376-
`nginx_gateway_fabric_nginx_reloads_milliseconds_sum{pod="%[1]s"} @ %[2]d)`+
377-
` / `+
378-
`(nginx_gateway_fabric_nginx_reloads_total{pod="%[1]s"}`+
379-
` - `+
380-
`nginx_gateway_fabric_nginx_reloads_total{pod="%[1]s"} @ %[2]d)`,
381-
ngfPodName,
382-
startTime.Unix(),
383-
),
384-
promInstance,
385-
)
386-
}
387-
388-
// GetReloadBuckets gets the Buckets in millisecond intervals for nginx reloads.
389-
func GetReloadBuckets(promInstance PrometheusInstance, ngfPodName string) ([]Bucket, error) {
390-
return getBuckets(
391-
fmt.Sprintf(
392-
`nginx_gateway_fabric_nginx_reloads_milliseconds_bucket{pod="%[1]s"}`,
393-
ngfPodName,
394-
),
395-
promInstance,
396-
)
397-
}
398-
399-
// GetReloadBucketsWithStartTime gets the Buckets in millisecond intervals for nginx reloads from a start time
400-
// to the current time.
401-
func GetReloadBucketsWithStartTime(
402-
promInstance PrometheusInstance,
403-
ngfPodName string,
404-
startTime time.Time,
405-
) ([]Bucket, error) {
406-
return getBuckets(
407-
fmt.Sprintf(
408-
`nginx_gateway_fabric_nginx_reloads_milliseconds_bucket{pod="%[1]s"}`+
409-
` - `+
410-
`nginx_gateway_fabric_nginx_reloads_milliseconds_bucket{pod="%[1]s"} @ %d`,
411-
ngfPodName,
412-
startTime.Unix(),
413-
),
414-
promInstance,
415-
)
416-
}
417-
418305
// GetEventsCount gets the NGF event batch processing count.
419306
func GetEventsCount(promInstance PrometheusInstance, ngfPodName string) (float64, error) {
420307
return getFirstValueOfVector(

tests/framework/resourcemanager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func (rm *ResourceManager) Delete(resources []client.Object, opts ...client.Dele
188188
}
189189

190190
func (rm *ResourceManager) DeleteNamespace(name string) error {
191-
ctx, cancel := context.WithTimeout(context.Background(), rm.TimeoutConfig.DeleteNamespaceTimeout)
191+
ctx, cancel := context.WithTimeout(context.Background(), rm.TimeoutConfig.DeleteNamespaceTimeout*2)
192192
defer cancel()
193193

194194
ns := &core.Namespace{}

tests/suite/manifests/scale/zero-downtime/values-affinity.yaml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,26 @@ nginxGateway:
33
preStop:
44
exec:
55
command:
6-
- /usr/bin/gateway
7-
- sleep
8-
- --duration=40s
6+
- /usr/bin/gateway
7+
- sleep
8+
- --duration=40s
9+
terminationGracePeriodSeconds: 50
10+
affinity:
11+
podAntiAffinity:
12+
requiredDuringSchedulingIgnoredDuringExecution:
13+
- topologyKey: kubernetes.io/hostname
14+
labelSelector:
15+
matchLabels:
16+
app.kubernetes.io/name: nginx-gateway
917

10-
nginx:
11-
lifecycle:
12-
preStop:
13-
exec:
14-
command:
15-
- /bin/sleep
16-
- "40"
17-
18-
terminationGracePeriodSeconds: 50
1918

20-
affinity:
21-
podAntiAffinity:
22-
requiredDuringSchedulingIgnoredDuringExecution:
23-
- topologyKey: kubernetes.io/hostname
24-
labelSelector:
25-
matchLabels:
26-
app.kubernetes.io/name: nginx-gateway
19+
nginx:
20+
pod:
21+
terminationGracePeriodSeconds: 50
22+
container:
23+
lifecycle:
24+
preStop:
25+
exec:
26+
command:
27+
- /bin/sleep
28+
- "40"

tests/suite/manifests/scale/zero-downtime/values.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ nginxGateway:
66
- /usr/bin/gateway
77
- sleep
88
- --duration=40s
9+
terminationGracePeriodSeconds: 50
910

1011
nginx:
11-
lifecycle:
12-
preStop:
13-
exec:
14-
command:
15-
- /bin/sleep
16-
- "40"
17-
18-
terminationGracePeriodSeconds: 50
12+
pod:
13+
terminationGracePeriodSeconds: 50
14+
container:
15+
lifecycle:
16+
preStop:
17+
exec:
18+
command:
19+
- /bin/sleep
20+
- "40"

0 commit comments

Comments
 (0)