Skip to content

Commit 8c855b3

Browse files
committed
Refactor l4lb-class to be modular and support mixed backend sizes
1 parent 0bcafeb commit 8c855b3

File tree

4 files changed

+128
-82
lines changed

4 files changed

+128
-82
lines changed
Lines changed: 37 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,23 @@
1-
# LOAD_BALANCER_BACKEND_SIZE specifies the number of backend pods behind each LB
2-
{{$LOAD_BALANCER_BACKEND_SIZE := DefaultParam .CL2_LOAD_BALANCER_BACKEND_SIZE 5}}
3-
# LOAD_BALANCER_REPLICAS specifies the number of Load balancer type service
4-
{{$LOAD_BALANCER_REPLICAS := DefaultParam .CL2_LOAD_BALANCER_REPLICAS 3}}
5-
# LOAD_BALANCER_TYPE specifies the type of L4 LB created. Valid values are "INTERNAL" and "EXTERNAL"
6-
{{$LOAD_BALANCER_TYPE := DefaultParam .CL2_LOAD_BALANCER_TYPE "EXTERNAL"}}
7-
# $EXTERNAL_TRAFFIC_POLICY specifies the externalTrafficPolicy on LB type service. Valid values are "Cluster" and "Local"
8-
{{$EXTERNAL_TRAFFIC_POLICY := DefaultParam .CL2_EXTERNAL_TRAFFIC_POLICY "Cluster"}}
9-
# $NODE_SYNC_TIMEOUT specifies the timeout to wait for nodesync to complete
10-
{{$NODE_SYNC_TIMEOUT := DefaultParam .CL2_NODE_SYNC_TIMEOUT "30m"}}
11-
# L4LB_SYNC_TIMEOUT specifies the timeout to wait for LB creation or deletion to complete
12-
{{$L4LB_SYNC_TIMEOUT := DefaultParam .CL2_L4LB_SYNC_TIMEOUT "30m"}}
13-
# LOAD_BALANCER_CLASS specifies the class of L4 LB.
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_ILB_TEST_QPS 20}}
145
{{$LOAD_BALANCER_CLASS := DefaultParam .CL2_LOAD_BALANCER_CLASS "invalid.scalability.gke.io"}}
156

16-
# adding a fixed value for first version of the test, rate of pod creation not a concern yet.
17-
{{$lbQPS := 20}}
18-
{{$namespaces := 1}}
19-
207
name: l4lbload
218
namespace:
22-
number: {{$namespaces}}
9+
number: 1
2310
tuningSets:
24-
- name: LBConstantQPS
11+
- name: ILBConstantQPS
2512
qpsLoad:
2613
qps: {{$lbQPS}}
2714
steps:
28-
- name: Initialize Measurements
29-
measurements:
30-
- Identifier: LBServiceCreationLatency
31-
Method: ServiceCreationLatency
32-
Params:
15+
- module:
16+
path: /modules/measurements.yaml
17+
params:
3318
action: start
34-
labelSelector: test = l4lb-load
35-
waitTimeout: {{$L4LB_SYNC_TIMEOUT}}
19+
- name: Start measurement for running pods
20+
measurements:
3621
- Identifier: WaitForRunningDeployments
3722
Method: WaitForControlledPodsRunning
3823
Params:
@@ -41,68 +26,38 @@ steps:
4126
kind: Deployment
4227
labelSelector: test = l4lb-load
4328
operationTimeout: 15m
44-
- name: Creating LBs
45-
phases:
46-
- namespaceRange:
47-
min: 1
48-
max: {{$namespaces}}
49-
replicasPerNamespace: {{$LOAD_BALANCER_REPLICAS}}
50-
tuningSet: LBConstantQPS
51-
objectBundle:
52-
- basename: lb-service
53-
objectTemplatePath: service.yaml
54-
templateFillMap:
55-
DeploymentBaseName: lb-dep
56-
ExternalTrafficPolicy: {{$EXTERNAL_TRAFFIC_POLICY}}
57-
LoadBalancerType: {{$LOAD_BALANCER_TYPE}}
58-
LoadBalancerClass: {{$LOAD_BALANCER_CLASS}}
59-
- basename: lb-dep
60-
objectTemplatePath: dep.yaml
61-
templateFillMap:
62-
NumReplicas: {{$LOAD_BALANCER_BACKEND_SIZE}}
63-
- name: Wait for LBs to be ready
64-
measurements:
65-
- Identifier: LBServiceCreationLatency
66-
Method: ServiceCreationLatency
67-
Params:
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:
6840
action: waitForReady
41+
- name: Waiting for objects creation to be completed
42+
measurements:
6943
- Identifier: WaitForRunningDeployments
7044
Method: WaitForControlledPodsRunning
7145
Params:
7246
action: gather
73-
- name: Measure NodeSync latency
47+
- module:
48+
path: /modules/services.yaml
49+
params:
50+
actionName: Delete
51+
largeBackendLbServiceCount: 0
52+
mediumBackendLbServiceCount: 0
53+
smallBackendLbServiceCount: 0
54+
- name: Waiting for objects deletion to be completed
7455
measurements:
75-
- Identifier: NodeSyncLatency
76-
Method: LoadBalancerNodeSyncLatency
77-
Params:
78-
action: measure
79-
labelSelector: test = l4lb-load
80-
waitTimeout: {{$NODE_SYNC_TIMEOUT}}
81-
- name: Deleting LBs
82-
phases:
83-
- namespaceRange:
84-
min: 1
85-
max: {{$namespaces}}
86-
replicasPerNamespace: 0
87-
tuningSet: LBConstantQPS
88-
objectBundle:
89-
- basename: lb-service
90-
objectTemplatePath: service.yaml
91-
- basename: lb-dep
92-
objectTemplatePath: dep.yaml
93-
- name: Wait for LBs to be deleted
94-
measurements:
95-
- Identifier: LBServiceCreationLatency
96-
Method: ServiceCreationLatency
97-
Params:
98-
action: waitForDeletion
99-
- name: Gather Measurements
100-
measurements:
101-
- Identifier: LBServiceCreationLatency
102-
Method: ServiceCreationLatency
56+
- Identifier: WaitForRunningDeployments
57+
Method: WaitForControlledPodsRunning
10358
Params:
10459
action: gather
105-
- Identifier: NodeSyncLatency
106-
Method: LoadBalancerNodeSyncLatency
107-
Params:
60+
- module:
61+
path: /modules/measurements.yaml
62+
params:
10863
action: gather
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+
{{$ilbWaitTimeout := DefaultParam .CL2_ILB_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: {{$ilbWaitTimeout}}
13+
labelSelector: size = ilb-large
14+
- Identifier: ServiceCreationLatencyMedium
15+
Method: ServiceCreationLatency
16+
Params:
17+
action: {{$action}}
18+
waitTimeout: {{$ilbWaitTimeout}}
19+
labelSelector: size = ilb-medium
20+
- Identifier: ServiceCreationLatencySmall
21+
Method: ServiceCreationLatency
22+
Params:
23+
action: {{$action}}
24+
waitTimeout: {{$ilbWaitTimeout}}
25+
labelSelector: size = ilb-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: ILBConstantQPS
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: ilb-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: ILBConstantQPS
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: ilb-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: ILBConstantQPS
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: ilb-small
61+
LoadBalancerClass: {{$LOAD_BALANCER_CLASS}}
62+
- basename: small-backends-dep
63+
objectTemplatePath: dep.yaml
64+
templateFillMap:
65+
NumReplicas: {{$SMALL_BACKEND_SIZE}}

clusterloader2/testing/l4lb-class/service.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ metadata:
44
name: {{.Name}}
55
labels:
66
test: l4lb-load
7+
size: {{.LBSizeLabel}}
78
annotations:
89
networking.gke.io/load-balancer-type: {{.LoadBalancerType}}
910
spec:

0 commit comments

Comments
 (0)