Skip to content

Commit 6280982

Browse files
committed
Add l4lb-class test scenario and refactor to be modular and generic
- Remove load-balancer-type annotation as LoadBalancerClass will be used. - Fix deletion wait in config.yaml to use waitForDeletion on ServiceCreationLatency.
1 parent ce78dc9 commit 6280982

File tree

5 files changed

+191
-0
lines changed

5 files changed

+191
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{{$LARGE_BACKEND_LB_SERVICE_COUNT := DefaultParam .CL2_LARGE_BACKEND_LB_SERVICE_COUNT 2}}
2+
{{$MEDIUM_BACKEND_LB_SERVICE_COUNT := DefaultParam .CL2_MEDIUM_BACKEND_LB_SERVICE_COUNT 2}}
3+
{{$SMALL_BACKEND_LB_SERVICE_COUNT := DefaultParam .CL2_SMALL_BACKEND_LB_SERVICE_COUNT 2}}
4+
{{$lbQPS := DefaultParam .CL2_LB_TEST_QPS 20}}
5+
{{$LOAD_BALANCER_CLASS := DefaultParam .CL2_LOAD_BALANCER_CLASS "invalid.scalability.gke.io"}}
6+
7+
name: l4lbload
8+
namespace:
9+
number: 1
10+
tuningSets:
11+
- name: LBConstantQPS
12+
qpsLoad:
13+
qps: {{$lbQPS}}
14+
steps:
15+
- module:
16+
path: /modules/measurements.yaml
17+
params:
18+
action: start
19+
- name: Start measurement for running pods
20+
measurements:
21+
- Identifier: WaitForRunningDeployments
22+
Method: WaitForControlledPodsRunning
23+
Params:
24+
action: start
25+
apiVersion: apps/v1
26+
kind: Deployment
27+
labelSelector: test = l4lb-load
28+
operationTimeout: 15m
29+
- module:
30+
path: /modules/services.yaml
31+
params:
32+
actionName: Create
33+
largeBackendLbServiceCount: {{$LARGE_BACKEND_LB_SERVICE_COUNT}}
34+
mediumBackendLbServiceCount: {{$MEDIUM_BACKEND_LB_SERVICE_COUNT}}
35+
smallBackendLbServiceCount: {{$SMALL_BACKEND_LB_SERVICE_COUNT}}
36+
CL2_LOAD_BALANCER_CLASS: {{$LOAD_BALANCER_CLASS}}
37+
- module:
38+
path: /modules/measurements.yaml
39+
params:
40+
action: waitForReady
41+
- name: Waiting for objects creation to be completed
42+
measurements:
43+
- Identifier: WaitForRunningDeployments
44+
Method: WaitForControlledPodsRunning
45+
Params:
46+
action: gather
47+
- module:
48+
path: /modules/services.yaml
49+
params:
50+
actionName: Delete
51+
largeBackendLbServiceCount: 0
52+
mediumBackendLbServiceCount: 0
53+
smallBackendLbServiceCount: 0
54+
- module:
55+
path: /modules/measurements.yaml
56+
params:
57+
action: waitForDeletion
58+
- module:
59+
path: /modules/measurements.yaml
60+
params:
61+
action: gather
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{.Name}}
5+
labels:
6+
test: l4lb-load
7+
spec:
8+
replicas: {{.NumReplicas}}
9+
selector:
10+
matchLabels:
11+
name: {{.Name}}
12+
template:
13+
metadata:
14+
labels:
15+
test: l4lb-load
16+
name: {{.Name}}
17+
spec:
18+
containers:
19+
- name: {{.Name}}
20+
image: nginx
21+
ports:
22+
- containerPort: 80
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Valid actions: "start", "waitForReady" and "gather"
2+
{{$action := .action}}
3+
{{$lbWaitTimeout := DefaultParam .CL2_LB_WAIT_TIMEOUT "10m"}}
4+
5+
steps:
6+
- name: Service creation latency measurements - '{{$action}}'
7+
measurements:
8+
- Identifier: ServiceCreationLatencyLarge
9+
Method: ServiceCreationLatency
10+
Params:
11+
action: {{$action}}
12+
waitTimeout: {{$lbWaitTimeout}}
13+
labelSelector: size = lb-large
14+
- Identifier: ServiceCreationLatencyMedium
15+
Method: ServiceCreationLatency
16+
Params:
17+
action: {{$action}}
18+
waitTimeout: {{$lbWaitTimeout}}
19+
labelSelector: size = lb-medium
20+
- Identifier: ServiceCreationLatencySmall
21+
Method: ServiceCreationLatency
22+
Params:
23+
action: {{$action}}
24+
waitTimeout: {{$lbWaitTimeout}}
25+
labelSelector: size = lb-small
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{{$EXTERNAL_TRAFFIC_POLICY := DefaultParam .CL2_EXTERNAL_TRAFFIC_POLICY "Cluster"}}
2+
{{$LARGE_BACKEND_SIZE := DefaultParam .CL2_LARGE_BACKEND_SIZE 300}}
3+
{{$MEDIUM_BACKEND_SIZE := DefaultParam .CL2_MEDIUM_BACKEND_SIZE 150}}
4+
{{$SMALL_BACKEND_SIZE := DefaultParam .CL2_SMALL_BACKEND_SIZE 10}}
5+
{{$LARGE_BACKEND_LB_SERVICE_COUNT := .largeBackendLbServiceCount}}
6+
{{$MEDIUM_BACKEND_LB_SERVICE_COUNT := .mediumBackendLbServiceCount}}
7+
{{$SMALL_BACKEND_LB_SERVICE_COUNT := .smallBackendLbServiceCount}}
8+
{{$LOAD_BALANCER_CLASS := DefaultParam .CL2_LOAD_BALANCER_CLASS "invalid.scalability.gke.io"}}
9+
{{$actionName := .actionName}}
10+
{{$namespaces := 1}}
11+
12+
steps:
13+
- name: {{$actionName}} LBs
14+
phases:
15+
- namespaceRange:
16+
min: 1
17+
max: {{$namespaces}}
18+
replicasPerNamespace: {{$LARGE_BACKEND_LB_SERVICE_COUNT}}
19+
tuningSet: LBConstantQPS
20+
objectBundle:
21+
- basename: large-backends-service
22+
objectTemplatePath: service.yaml
23+
templateFillMap:
24+
DeploymentBaseName: large-backends-dep
25+
ExternalTrafficPolicy: {{$EXTERNAL_TRAFFIC_POLICY}}
26+
LBSizeLabel: lb-large
27+
LoadBalancerClass: {{$LOAD_BALANCER_CLASS}}
28+
- basename: large-backends-dep
29+
objectTemplatePath: dep.yaml
30+
templateFillMap:
31+
NumReplicas: {{$LARGE_BACKEND_SIZE}}
32+
- namespaceRange:
33+
min: 1
34+
max: {{$namespaces}}
35+
replicasPerNamespace: {{$MEDIUM_BACKEND_LB_SERVICE_COUNT}}
36+
tuningSet: LBConstantQPS
37+
objectBundle:
38+
- basename: medium-backends-service
39+
objectTemplatePath: service.yaml
40+
templateFillMap:
41+
DeploymentBaseName: medium-backends-dep
42+
ExternalTrafficPolicy: {{$EXTERNAL_TRAFFIC_POLICY}}
43+
LBSizeLabel: lb-medium
44+
LoadBalancerClass: {{$LOAD_BALANCER_CLASS}}
45+
- basename: medium-backends-dep
46+
objectTemplatePath: dep.yaml
47+
templateFillMap:
48+
NumReplicas: {{$MEDIUM_BACKEND_SIZE}}
49+
- namespaceRange:
50+
min: 1
51+
max: {{$namespaces}}
52+
replicasPerNamespace: {{$SMALL_BACKEND_LB_SERVICE_COUNT}}
53+
tuningSet: LBConstantQPS
54+
objectBundle:
55+
- basename: small-backends-service
56+
objectTemplatePath: service.yaml
57+
templateFillMap:
58+
DeploymentBaseName: small-backends-dep
59+
ExternalTrafficPolicy: {{$EXTERNAL_TRAFFIC_POLICY}}
60+
LBSizeLabel: lb-small
61+
LoadBalancerClass: {{$LOAD_BALANCER_CLASS}}
62+
- basename: small-backends-dep
63+
objectTemplatePath: dep.yaml
64+
templateFillMap:
65+
NumReplicas: {{$SMALL_BACKEND_SIZE}}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{.Name}}
5+
labels:
6+
test: l4lb-load
7+
size: {{.LBSizeLabel}}
8+
spec:
9+
{{if .LoadBalancerClass}}
10+
loadBalancerClass: {{.LoadBalancerClass}}
11+
{{end}}
12+
externalTrafficPolicy: {{.ExternalTrafficPolicy}}
13+
type: LoadBalancer
14+
selector:
15+
name: {{.DeploymentBaseName}}-{{.Index}}
16+
ports:
17+
- port: 80
18+
targetPort: 80

0 commit comments

Comments
 (0)