-
Notifications
You must be signed in to change notification settings - Fork 569
/
Copy pathconfig.yaml
463 lines (422 loc) · 17 KB
/
config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
# ASSUMPTIONS:
# - Underlying cluster should have 100+ nodes.
# - Number of nodes should be divisible by NODES_PER_NAMESPACE (default 100).
# - The number of created SVCs is half the number of created Deployments.
# - Only half of Deployments will be assigned 1-1 to existing SVCs.
#Constants
# Cater for the case where the number of nodes is less than nodes per namespace. See https://github.com/kubernetes/perf-tests/issues/887
{{$NODES_PER_NAMESPACE := MinInt .Nodes (DefaultParam .NODES_PER_NAMESPACE 100)}}
# See https://github.com/kubernetes/perf-tests/pull/1667#issuecomment-769642266
{{$IS_SMALL_CLUSTER := lt .Nodes 100}}
{{$PODS_PER_NODE := DefaultParam .PODS_PER_NODE 30}}
{{$LOAD_TEST_THROUGHPUT := DefaultParam .CL2_LOAD_TEST_THROUGHPUT 10}}
{{$DELETE_TEST_THROUGHPUT := DefaultParam .CL2_DELETE_TEST_THROUGHPUT $LOAD_TEST_THROUGHPUT}}
{{$RATE_LIMIT_POD_CREATION := DefaultParam .CL2_RATE_LIMIT_POD_CREATION true}}
{{$BIG_GROUP_SIZE := DefaultParam .BIG_GROUP_SIZE 250}}
{{$MEDIUM_GROUP_SIZE := DefaultParam .MEDIUM_GROUP_SIZE 30}}
{{$SMALL_GROUP_SIZE := DefaultParam .SMALL_GROUP_SIZE 5}}
{{$SMALL_STATEFUL_SETS_PER_NAMESPACE := DefaultParam .SMALL_STATEFUL_SETS_PER_NAMESPACE 1}}
{{$MEDIUM_STATEFUL_SETS_PER_NAMESPACE := DefaultParam .MEDIUM_STATEFUL_SETS_PER_NAMESPACE 1}}
{{$ENABLE_CHAOSMONKEY := DefaultParam .ENABLE_CHAOSMONKEY false}}
{{$ENABLE_API_AVAILABILITY_MEASUREMENT := DefaultParam .CL2_ENABLE_API_AVAILABILITY_MEASUREMENT false}}
{{$ENABLE_NETWORK_POLICY_ENFORCEMENT_LATENCY_TEST := DefaultParam .CL2_ENABLE_NETWORK_POLICY_ENFORCEMENT_LATENCY_TEST false}}
{{$RANDOM_SCALE_FACTOR := 0.5}}
#Variables
{{$namespaces := DivideInt .Nodes $NODES_PER_NAMESPACE}}
{{$totalPods := MultiplyInt $namespaces $NODES_PER_NAMESPACE $PODS_PER_NODE}}
{{$podsPerNamespace := DivideInt $totalPods $namespaces}}
{{$saturationTime := DivideInt $totalPods $LOAD_TEST_THROUGHPUT}}
{{$deletionTime := DivideInt $totalPods $DELETE_TEST_THROUGHPUT}}
# bigDeployments - 1/4 of namespace pods should be in big Deployments.
{{$bigDeploymentsPerNamespace := DivideInt $podsPerNamespace (MultiplyInt 4 $BIG_GROUP_SIZE)}}
# mediumDeployments - 1/4 of namespace pods should be in medium Deployments.
{{$mediumDeploymentsPerNamespace := DivideInt $podsPerNamespace (MultiplyInt 4 $MEDIUM_GROUP_SIZE)}}
# smallDeployments - 1/2 of namespace pods should be in small Deployments.
{{$smallDeploymentsPerNamespace := DivideInt $podsPerNamespace (MultiplyInt 2 $SMALL_GROUP_SIZE)}}
# Stateful sets are enabled. Reduce the number of small and medium deployments per namespace
# See https://github.com/kubernetes/perf-tests/issues/1036#issuecomment-607631768
# Ensure non zero or negative after subtraction.
{{$smallDeploymentsPerNamespace := MaxInt 0 (SubtractInt $smallDeploymentsPerNamespace $SMALL_STATEFUL_SETS_PER_NAMESPACE)}}
{{$mediumDeploymentsPerNamespace := MaxInt 0 (SubtractInt $mediumDeploymentsPerNamespace $MEDIUM_STATEFUL_SETS_PER_NAMESPACE)}}
# Jobs are enabled. Reduce the number of small, medium, big deployments per namespace.
# Ensure non zero or negative after subtraction.
{{$smallDeploymentsPerNamespace := MaxInt 0 (SubtractInt $smallDeploymentsPerNamespace 1)}}
{{$mediumDeploymentsPerNamespace := MaxInt 0 (SubtractInt $mediumDeploymentsPerNamespace 1)}}
{{$bigDeploymentsPerNamespace := MaxInt 0 (SubtractInt $bigDeploymentsPerNamespace 1)}}
# Disable big jobs on small clusters.
{{$bigJobsPerNamespace := IfThenElse $IS_SMALL_CLUSTER 0 1}}
# The minimal number of pods to be used to measure various things like
# pod-startup-latency or scheduler-throughput. The purpose of it is to avoid
# problems in small clusters where we wouldn't have enough samples (pods) to
# measure things accurately.
{{$MIN_PODS_IN_SMALL_CLUSTERS := 500}}
# BEGIN scheduler-throughput section
# TODO( https://github.com/kubernetes/perf-tests/issues/1027): Lower the number of "min-pods" once we fix the scheduler throughput measurement.
{{$totalSchedulerThroughputPods := MaxInt (MultiplyInt 2 $MIN_PODS_IN_SMALL_CLUSTERS) .Nodes}}
# Determines number of pods per deployment. Should be a divider of $totalSchedulerThroughputPods.
{{$schedulerThroughputPodsPerDeployment := DefaultParam .CL2_SCHEDULER_THROUGHPUT_PODS_PER_DEPLOYMENT $totalSchedulerThroughputPods}}
{{$schedulerThroughputNamespaces := DivideInt $totalSchedulerThroughputPods $schedulerThroughputPodsPerDeployment}}
# Set schedulerThroughputNamespaces to 1 on small clusters otherwise it will result
# in an unnecessary number of namespaces.
{{$schedulerThroughputNamespaces := IfThenElse $IS_SMALL_CLUSTER 1 $schedulerThroughputNamespaces}}
# END scheduler-throughput section
# Command to be executed
{{$EXEC_COMMAND := DefaultParam .CL2_EXEC_COMMAND nil}}
{{$EXIT_AFTER_EXEC := DefaultParam .CL2_EXIT_AFTER_EXEC false}}
{{$EXEC_TIMEOUT := DefaultParam .CL2_EXEC_TIMEOUT "3600s"}}
{{$SLEEP_AFTER_EXEC_DURATION := DefaultParam .CL2_SLEEP_AFTER_EXEC_DURATION "0s"}}
{{$registry := DefaultParam .CL2_LATENCY_POD_REGISTRY "registry.k8s.io"}}
{{$latencyPodImage := DefaultParam .CL2_LATENCY_POD_IMAGE (Concat $registry "/pause:3.9")}}
{{$defaultQps := DefaultParam .CL2_DEFAULT_QPS (IfThenElse (le .Nodes 500) 10 100)}}
{{$ADDITIONAL_MEASUREMENT_MODULES := DefaultParam .CL2_ADDITIONAL_MEASUREMENT_MODULES nil}}
{{$ADDITIONAL_PHASES_MODULES := DefaultParam .CL2_ADDITIONAL_PHASES_MODULES nil}}
name: load
namespace:
number: {{AddInt $namespaces $schedulerThroughputNamespaces}}
tuningSets:
- name: Sequence
parallelismLimitedLoad:
parallelismLimit: 1
# TODO(https://github.com/kubernetes/perf-tests/issues/1024): This TuningSet is used only for pod-startup-latency, get rid of it
# Uniform5qps: for each running phase, use 5 qps.
- name: Uniform5qps
qpsLoad:
qps: 5
# default is a tuningset that is meant to be used when we don't have any specific requirements on pace of operations.
- name: default
globalQPSLoad:
qps: {{$defaultQps}}
burst: 1
- name: RandomizedSaturationTimeLimited
RandomizedTimeLimitedLoad:
timeLimit: {{$saturationTime}}s
- name: RandomizedScalingTimeLimited
RandomizedTimeLimitedLoad:
# The expected number of created/deleted pods is totalPods/4 when scaling,
# as each RS changes its size from X to a uniform random value in [X/2, 3X/2].
# To match 10 [pods/s] requirement, we need to divide saturationTime by 4.
timeLimit: {{DivideInt $saturationTime 4}}s
- name: RandomizedDeletionTimeLimited
RandomizedTimeLimitedLoad:
timeLimit: {{$deletionTime}}s
{{if $ENABLE_CHAOSMONKEY}}
chaosMonkey:
nodeFailure:
failureRate: 0.01
interval: 5m
jitterFactor: 2.0
simulatedDowntime: 10m
{{end}}
steps:
- module:
path: /modules/measurements.yaml
params:
action: start
{{if $ADDITIONAL_MEASUREMENT_MODULES}}
{{range $ADDITIONAL_MEASUREMENT_MODULES}}
- module:
path: {{.}}
params:
action: start
{{end}}
{{end}}
{{if $ENABLE_NETWORK_POLICY_ENFORCEMENT_LATENCY_TEST}}
- module:
path: modules/network-policy/net-policy-enforcement-latency.yaml
params:
setup: true
run: true
testType: "pod-creation"
{{end}}
- module:
path: modules/services.yaml
params:
actionName: "Creating"
namespaces: {{$namespaces}}
smallServicesPerNamespace: {{DivideInt (AddInt $smallDeploymentsPerNamespace 1) 2}}
mediumServicesPerNamespace: {{DivideInt (AddInt $mediumDeploymentsPerNamespace 1) 2}}
bigServicesPerNamespace: {{DivideInt (AddInt $bigDeploymentsPerNamespace 1) 2}}
- name: Creating PriorityClass for DaemonSets
phases:
- replicasPerNamespace: 1
tuningSet: Sequence
objectBundle:
- basename: daemonset-priorityclass
objectTemplatePath: daemonset-priorityclass.yaml
# Moved from reconcile-objects.yaml to mitigate https://github.com/kubernetes/kubernetes/issues/96635.
# TODO(https://github.com/kubernetes/perf-tests/issues/1823): Merge back to reconcile-objects.yaml once the k/k bug is fixed.
- module:
path: /modules/configmaps-secrets.yaml
params:
actionName: create
tuningSet: default
namespaces: {{$namespaces}}
bigDeploymentsPerNamespace: {{$bigDeploymentsPerNamespace}}
mediumDeploymentsPerNamespace: {{$mediumDeploymentsPerNamespace}}
smallDeploymentsPerNamespace: {{$smallDeploymentsPerNamespace}}
- module:
path: /modules/reconcile-objects.yaml
params:
actionName: "create"
namespaces: {{$namespaces}}
{{if $RATE_LIMIT_POD_CREATION}}
tuningSet: RandomizedSaturationTimeLimited
operationTimeout: 15m
{{else}}
tuningSet: default
operationTimeout: {{AddInt $saturationTime 900}}s
{{end}}
testMaxReplicaFactor: {{$RANDOM_SCALE_FACTOR}}
# We rely on the fact that daemonset is using the same image as the 'pod-startup-latency' module.
# The goal is to cache the image to all nodes before we start any latency pod,
# so that when we measure pod startup latency, the image is already present on all nodes.
# This way, the pod startup latency we measure excludes (or limits impact) of image pulling,
# whuch matches our SLO definition: https://github.com/kubernetes/community/blob/master/sig-scalability/slos/pod_startup_latency.md.
daemonSetImage: {{$latencyPodImage}}
deploymentImage: {{$latencyPodImage}}
jobImage: {{$latencyPodImage}}
statefulSetImage: {{$latencyPodImage}}
daemonSetEnv: "before update"
daemonSetReplicas: 1
bigDeploymentSize: {{$BIG_GROUP_SIZE}}
bigDeploymentsPerNamespace: {{$bigDeploymentsPerNamespace}}
mediumDeploymentSize: {{$MEDIUM_GROUP_SIZE}}
mediumDeploymentsPerNamespace: {{$mediumDeploymentsPerNamespace}}
smallDeploymentSize: {{$SMALL_GROUP_SIZE}}
smallDeploymentsPerNamespace: {{$smallDeploymentsPerNamespace}}
smallStatefulSetSize: {{$SMALL_GROUP_SIZE}}
smallStatefulSetsPerNamespace: {{$SMALL_STATEFUL_SETS_PER_NAMESPACE}}
mediumStatefulSetSize: {{$MEDIUM_GROUP_SIZE}}
mediumStatefulSetsPerNamespace: {{$MEDIUM_STATEFUL_SETS_PER_NAMESPACE}}
bigJobSize: {{$BIG_GROUP_SIZE}}
bigJobsPerNamespace: {{$bigJobsPerNamespace}}
mediumJobSize: {{$MEDIUM_GROUP_SIZE}}
mediumJobsPerNamespace: 1
smallJobSize: {{$SMALL_GROUP_SIZE}}
smallJobsPerNamespace: 1
{{if $ADDITIONAL_PHASES_MODULES}}
{{range $ADDITIONAL_PHASES_MODULES}}
- module:
path: {{.}}
params:
action: "create"
{{end}}
{{end}}
{{if not $IS_SMALL_CLUSTER}}
# BEGIN scheduler throughput
- module:
path: modules/scheduler-throughput.yaml
params:
action: create
namespaces: {{$namespaces}}
replicasPerNamespace: 1
schedulerThroughputNamespaces: {{$schedulerThroughputNamespaces}}
schedulerThroughputPodsPerDeployment: {{$schedulerThroughputPodsPerDeployment}}
deploymentImage: {{$latencyPodImage}}
{{end}}
- module:
path: modules/dns-k8s-hostnames.yaml
{{if $EXEC_COMMAND}}
{{if $ENABLE_API_AVAILABILITY_MEASUREMENT}}
- name: Pausing APIAvailability measurement
measurements:
- Identifier: APIAvailability
Method: APIAvailability
Params:
action: pause
{{end}}
- name: Exec command
measurements:
- Identifier: ExecCommand
Method: Exec
Params:
timeout: {{$EXEC_TIMEOUT}}
command:
{{range $EXEC_COMMAND}}
- {{.}}
{{end}}
{{if $ENABLE_API_AVAILABILITY_MEASUREMENT}}
- name: Unpausing APIAvailability measurement
measurements:
- Identifier: APIAvailability
Method: APIAvailability
Params:
action: unpause
{{end}}
- name: Sleep
measurements:
- Identifier: WaitAfterExec
Method: Sleep
Params:
duration: {{$SLEEP_AFTER_EXEC_DURATION}}
{{end}}
{{if not $EXIT_AFTER_EXEC}}
{{if not $IS_SMALL_CLUSTER}}
- module:
path: modules/scheduler-throughput.yaml
params:
action: delete
namespaces: {{$namespaces}}
replicasPerNamespace: 0
schedulerThroughputNamespaces: {{$schedulerThroughputNamespaces}}
schedulerThroughputPodsPerDeployment: {{$schedulerThroughputPodsPerDeployment}}
# END scheduler throughput
{{end}}
{{if not $IS_SMALL_CLUSTER}}
# TODO(kubernetes/perf-tests/issues/1024): We shouldn't have a dedicated module for measuring pod-startup-latency.
- module:
path: modules/pod-startup-latency.yaml
params:
namespaces: {{$namespaces}}
minPodsInSmallCluster: {{$MIN_PODS_IN_SMALL_CLUSTERS}}
image: {{$latencyPodImage}}
{{end}}
{{if $ENABLE_NETWORK_POLICY_ENFORCEMENT_LATENCY_TEST}}
- module:
path: modules/network-policy/net-policy-metrics.yaml
params:
action: gather
usePolicyCreationMetrics: false
- module:
path: modules/network-policy/net-policy-enforcement-latency.yaml
params:
complete: true
testType: "pod-creation"
- module:
path: modules/network-policy/net-policy-enforcement-latency.yaml
params:
run: true
testType: "policy-creation"
{{end}}
- module:
path: /modules/reconcile-objects.yaml
params:
actionName: "scale and update"
namespaces: {{$namespaces}}
{{if $RATE_LIMIT_POD_CREATION}}
tuningSet: RandomizedScalingTimeLimited
operationTimeout: 15m
{{else}}
tuningSet: default
operationTimeout: {{AddInt (DivideInt $saturationTime 4) 900}}s
{{end}}
randomScaleFactor: {{$RANDOM_SCALE_FACTOR}}
testMaxReplicaFactor: {{$RANDOM_SCALE_FACTOR}}
daemonSetImage: {{$latencyPodImage}}
deploymentImage: {{$latencyPodImage}}
jobImage: {{$latencyPodImage}}
statefulSetImage: {{$latencyPodImage}}
daemonSetEnv: "after update"
daemonSetReplicas: 1
bigDeploymentSize: {{$BIG_GROUP_SIZE}}
bigDeploymentsPerNamespace: {{$bigDeploymentsPerNamespace}}
mediumDeploymentSize: {{$MEDIUM_GROUP_SIZE}}
mediumDeploymentsPerNamespace: {{$mediumDeploymentsPerNamespace}}
smallDeploymentSize: {{$SMALL_GROUP_SIZE}}
smallDeploymentsPerNamespace: {{$smallDeploymentsPerNamespace}}
smallStatefulSetSize: {{$SMALL_GROUP_SIZE}}
smallStatefulSetsPerNamespace: {{$SMALL_STATEFUL_SETS_PER_NAMESPACE}}
mediumStatefulSetSize: {{$MEDIUM_GROUP_SIZE}}
mediumStatefulSetsPerNamespace: {{$MEDIUM_STATEFUL_SETS_PER_NAMESPACE}}
bigJobSize: {{$BIG_GROUP_SIZE}}
bigJobsPerNamespace: {{$bigJobsPerNamespace}}
mediumJobSize: {{$MEDIUM_GROUP_SIZE}}
mediumJobsPerNamespace: 1
smallJobSize: {{$SMALL_GROUP_SIZE}}
smallJobsPerNamespace: 1
{{if $ADDITIONAL_PHASES_MODULES}}
{{range $ADDITIONAL_PHASES_MODULES}}
- module:
path: {{.}}
params:
action: "scale and update"
{{end}}
{{end}}
- module:
path: /modules/reconcile-objects.yaml
params:
actionName: "delete"
namespaces: {{$namespaces}}
{{if $RATE_LIMIT_POD_CREATION}}
tuningSet: RandomizedDeletionTimeLimited
operationTimeout: 15m
{{else}}
tuningSet: default
operationTimeout: {{AddInt $deletionTime 900}}s
{{end}}
testMaxReplicaFactor: {{$RANDOM_SCALE_FACTOR}}
daemonSetImage: {{$latencyPodImage}}
deploymentImage: {{$latencyPodImage}}
jobImage: {{$latencyPodImage}}
statefulSetImage: {{$latencyPodImage}}
daemonSetReplicas: 0
bigDeploymentSize: {{$BIG_GROUP_SIZE}}
bigDeploymentsPerNamespace: 0
mediumDeploymentSize: {{$MEDIUM_GROUP_SIZE}}
mediumDeploymentsPerNamespace: 0
smallDeploymentSize: {{$SMALL_GROUP_SIZE}}
smallDeploymentsPerNamespace: 0
smallStatefulSetSize: {{$SMALL_GROUP_SIZE}}
smallStatefulSetsPerNamespace: 0
mediumStatefulSetSize: {{$MEDIUM_GROUP_SIZE}}
mediumStatefulSetsPerNamespace: 0
bigJobSize: {{$BIG_GROUP_SIZE}}
bigJobsPerNamespace: 0
mediumJobSize: {{$MEDIUM_GROUP_SIZE}}
mediumJobsPerNamespace: 0
smallJobSize: {{$SMALL_GROUP_SIZE}}
smallJobsPerNamespace: 0
pvSmallStatefulSetSize: {{$SMALL_STATEFUL_SETS_PER_NAMESPACE}}
pvMediumStatefulSetSize: {{$MEDIUM_STATEFUL_SETS_PER_NAMESPACE}}
{{if $ADDITIONAL_PHASES_MODULES}}
{{range $ADDITIONAL_PHASES_MODULES}}
- module:
path: {{.}}
params:
action: "delete"
{{end}}
{{end}}
- module:
path: /modules/configmaps-secrets.yaml
params:
actionName: delete
tuningSet: default
namespaces: {{$namespaces}}
bigDeploymentsPerNamespace: 0
mediumDeploymentsPerNamespace: 0
smallDeploymentsPerNamespace: 0
- name: Deleting PriorityClass for DaemonSets
phases:
- replicasPerNamespace: 0
tuningSet: Sequence
objectBundle:
- basename: daemonset-priorityclass
objectTemplatePath: daemonset-priorityclass.yaml
- module:
path: modules/services.yaml
params:
actionName: "Deleting"
namespaces: {{$namespaces}}
smallServicesPerNamespace: 0
mediumServicesPerNamespace: 0
bigServicesPerNamespace: 0
{{end}} # not EXIT_AFTER_EXEC
- module:
path: /modules/measurements.yaml
params:
action: gather
{{if $ADDITIONAL_MEASUREMENT_MODULES}}
{{range $ADDITIONAL_MEASUREMENT_MODULES}}
- module:
path: {{.}}
params:
action: gather
{{end}}
{{end}}
{{if $ENABLE_NETWORK_POLICY_ENFORCEMENT_LATENCY_TEST}}
- module:
path: modules/network-policy/net-policy-enforcement-latency.yaml
params:
complete: true
testType: "policy-creation"
{{end}}