@@ -30,6 +30,12 @@ if [[ -z "${SCALE_SCENARIO:-}" ]]; then
3030 export SCALE_SCENARIO
3131fi
3232
33+ # Default scale test tool to clusterloader2
34+ if [[ -z " ${SCALE_TEST_TOOL:- } " ]]; then
35+ SCALE_TEST_TOOL=" clusterloader2"
36+ fi
37+ echo " SCALE_TEST_TOOL=${SCALE_TEST_TOOL} "
38+
3339# Default cloud provider to aws
3440if [[ -z " ${CLOUD_PROVIDER:- } " ]]; then
3541 CLOUD_PROVIDER=" aws"
197203# used by CL2 Prometheus here https://github.com/kubernetes/perf-tests/blob/master/clusterloader2/pkg/prometheus/manifests/default/kube-proxy-service.yaml#L2
198204export PROMETHEUS_KUBE_PROXY_SELECTOR_KEY=" k8s-app"
199205export ETCD_PORT=" 4001" # we want cl2 to use this port for etcd instead of 2379
200- if [[ " ${CLOUD_PROVIDER} " == " aws" && " ${SCALE_SCENARIO} " == " performance" ]]; then
201- # CL2 uses KUBE_SSH_KEY_PATH path to ssh to instances for scraping metrics
202- cat > " ${GOPATH} " /src/k8s.io/perf-tests/clusterloader2/testing/load/overrides.yaml << EOL
203- # we are not testing PVS at this point
204- CL2_ENABLE_PVS: false
205- ENABLE_RESTART_COUNT_CHECK: false
206+
207+ if [[ " ${SCALE_TEST_TOOL} " == " clusterloader2" ]]; then
208+ if [[ " ${CLOUD_PROVIDER} " == " aws" && " ${SCALE_SCENARIO} " == " performance" ]]; then
209+ # CL2 uses KUBE_SSH_KEY_PATH path to ssh to instances for scraping metrics
210+ cat > " ${GOPATH} " /src/k8s.io/perf-tests/clusterloader2/testing/load/overrides.yaml << EOL
211+ # we are not testing PVS at this point
212+ CL2_ENABLE_PVS: false
213+ ENABLE_RESTART_COUNT_CHECK: false
206214EOL
207- cat " ${GOPATH} " /src/k8s.io/perf-tests/clusterloader2/testing/load/overrides.yaml
208- else
209- cat > " ${GOPATH} " /src/k8s.io/perf-tests/clusterloader2/testing/load/overrides.yaml << EOL
210- # setting a default value here to avoid an incorrect yaml file
211- CL2_ENABLE_PVS: true
215+ cat " ${GOPATH} " /src/k8s.io/perf-tests/clusterloader2/testing/load/overrides.yaml
216+ else
217+ cat > " ${GOPATH} " /src/k8s.io/perf-tests/clusterloader2/testing/load/overrides.yaml << EOL
218+ # setting a default value here to avoid an incorrect yaml file
219+ CL2_ENABLE_PVS: true
212220EOL
213- fi
221+ fi
214222
215- CLUSTERLOADER2_ARGS=()
216- if [[ -n " ${KOPS_CL2_TEST_CONFIG} " ]]; then
217- CLUSTERLOADER2_ARGS+=(" --test-configs=${GOPATH} /src/k8s.io/perf-tests/clusterloader2/${KOPS_CL2_TEST_CONFIG} " )
218- else
219- CLUSTERLOADER2_ARGS+=(" --test-configs=${GOPATH} /src/k8s.io/perf-tests/clusterloader2/testing/load/config.yaml" )
220- CLUSTERLOADER2_ARGS+=(" --test-configs=${GOPATH} /src/k8s.io/perf-tests/clusterloader2/testing/access-tokens/config.yaml" )
221- CLUSTERLOADER2_ARGS+=(" --test-overrides=${GOPATH} /src/k8s.io/perf-tests/clusterloader2/testing/load/overrides.yaml" )
222- CLUSTERLOADER2_ARGS+=(" --test-overrides=${GOPATH} /src/k8s.io/perf-tests/clusterloader2/testing/experiments/enable_restart_count_check.yaml" )
223- CLUSTERLOADER2_ARGS+=(" --test-overrides=${GOPATH} /src/k8s.io/perf-tests/clusterloader2/testing/experiments/ignore_known_gce_container_restarts.yaml" )
224- CLUSTERLOADER2_ARGS+=(" --test-overrides=${GOPATH} /src/k8s.io/perf-tests/clusterloader2/testing/overrides/5000_nodes.yaml" )
225- CLUSTERLOADER2_ARGS+=(" --extra-args=--experimental-prometheus-snapshot-to-report-dir=true" )
223+ CLUSTERLOADER2_ARGS=()
224+ if [[ -n " ${KOPS_CL2_TEST_CONFIG} " ]]; then
225+ CLUSTERLOADER2_ARGS+=(" --test-configs=${GOPATH} /src/k8s.io/perf-tests/clusterloader2/${KOPS_CL2_TEST_CONFIG} " )
226+ else
227+ CLUSTERLOADER2_ARGS+=(" --test-configs=${GOPATH} /src/k8s.io/perf-tests/clusterloader2/testing/load/config.yaml" )
228+ CLUSTERLOADER2_ARGS+=(" --test-configs=${GOPATH} /src/k8s.io/perf-tests/clusterloader2/testing/access-tokens/config.yaml" )
229+ CLUSTERLOADER2_ARGS+=(" --test-overrides=${GOPATH} /src/k8s.io/perf-tests/clusterloader2/testing/load/overrides.yaml" )
230+ CLUSTERLOADER2_ARGS+=(" --test-overrides=${GOPATH} /src/k8s.io/perf-tests/clusterloader2/testing/experiments/enable_restart_count_check.yaml" )
231+ CLUSTERLOADER2_ARGS+=(" --test-overrides=${GOPATH} /src/k8s.io/perf-tests/clusterloader2/testing/experiments/ignore_known_gce_container_restarts.yaml" )
232+ CLUSTERLOADER2_ARGS+=(" --test-overrides=${GOPATH} /src/k8s.io/perf-tests/clusterloader2/testing/overrides/5000_nodes.yaml" )
233+ CLUSTERLOADER2_ARGS+=(" --extra-args=--experimental-prometheus-snapshot-to-report-dir=true" )
234+ fi
235+
236+ # ToDo: remove this once we can run the huge-service test on AWS
237+ if [[ -z " ${KOPS_CL2_TEST_CONFIG} " && " ${CLOUD_PROVIDER} " == " gce" ]]; then
238+ CLUSTERLOADER2_ARGS+=(" --test-configs=${GOPATH} /src/k8s.io/perf-tests/clusterloader2/testing/huge-service/config.yaml" )
239+ fi
226240fi
227241
228- # ToDo: remove this once we can run the huge-service test on AWS
229- if [[ -z " ${KOPS_CL2_TEST_CONFIG} " && " ${CLOUD_PROVIDER} " == " gce" ]]; then
230- CLUSTERLOADER2_ARGS+=(" --test-configs=${GOPATH} /src/k8s.io/perf-tests/clusterloader2/testing/huge-service/config.yaml" )
242+ if [[ " ${SCALE_TEST_TOOL} " == " kube-burner" ]]; then
243+ # Download and install kube-burner if path not already specified
244+ if [[ -z " ${KUBE_BURNER_PATH:- } " ]]; then
245+ if [[ -z " ${KUBE_BURNER_VERSION:- } " ]]; then
246+ KUBE_BURNER_VERSION=$( curl -fsSL https://api.github.com/repos/kube-burner/kube-burner/releases/latest | grep -o ' "tag_name": "v[^"]*"' | sed ' s/"tag_name": "v\(.*\)"/\1/' )
247+ fi
248+ KUBE_BURNER_OS=$( uname -s | tr ' [:upper:]' ' [:lower:]' )
249+ KUBE_BURNER_ARCH=$( uname -m)
250+ if [[ " ${KUBE_BURNER_ARCH} " == " aarch64" ]]; then
251+ KUBE_BURNER_ARCH=" arm64"
252+ fi
253+ KUBE_BURNER_DIR=$( mktemp -d)
254+ KUBE_BURNER_TARBALL=" kube-burner-V${KUBE_BURNER_VERSION} -${KUBE_BURNER_OS} -${KUBE_BURNER_ARCH} .tar.gz"
255+ KUBE_BURNER_URL=" https://github.com/kube-burner/kube-burner/releases/download/v${KUBE_BURNER_VERSION} /${KUBE_BURNER_TARBALL} "
256+ echo " Downloading kube-burner ${KUBE_BURNER_VERSION} from ${KUBE_BURNER_URL} "
257+ curl -fsSL " ${KUBE_BURNER_URL} " -o " ${KUBE_BURNER_DIR} /${KUBE_BURNER_TARBALL} "
258+ tar -xzf " ${KUBE_BURNER_DIR} /${KUBE_BURNER_TARBALL} " -C " ${KUBE_BURNER_DIR} "
259+ KUBE_BURNER_PATH=" ${KUBE_BURNER_DIR} /kube-burner"
260+ chmod +x " ${KUBE_BURNER_PATH} "
261+ echo " kube-burner ${KUBE_BURNER_VERSION} installed at ${KUBE_BURNER_PATH} "
262+ fi
263+
264+ KUBE_BURNER_ARGS=()
265+ KUBE_BURNER_ARGS+=(" --workdir=${KUBE_BURNER_WORKDIR:- k8s.io/ perf-tests} " )
266+ KUBE_BURNER_ARGS+=(" --workload=${KUBE_BURNER_WORKLOAD} " )
267+ KUBE_BURNER_ARGS+=(" --kube-burner-path=${KUBE_BURNER_PATH} " )
268+ if [[ -n " ${KUBE_BURNER_UUID:- } " ]]; then
269+ KUBE_BURNER_ARGS+=(" --uuid=${KUBE_BURNER_UUID} " )
270+ fi
271+ if [[ " ${KUBE_BURNER_SKIP_TLS_VERIFY:- } " == " true" ]]; then
272+ KUBE_BURNER_ARGS+=(" --skip-tls-verify" )
273+ fi
274+ if [[ -n " ${KUBE_BURNER_KUBECONFIG:- } " ]]; then
275+ KUBE_BURNER_ARGS+=(" --kubeconfig=${KUBE_BURNER_KUBECONFIG} " )
276+ fi
277+ if [[ -n " ${KUBE_BURNER_LOG_LEVEL:- } " ]]; then
278+ KUBE_BURNER_ARGS+=(" --log-level=${KUBE_BURNER_LOG_LEVEL} " )
279+ fi
280+ if [[ -n " ${KUBE_BURNER_EXTRA_ARGS:- } " ]]; then
281+ KUBE_BURNER_ARGS+=(" --extra-args=${KUBE_BURNER_EXTRA_ARGS} " )
282+ fi
231283fi
232284
233285if [[ " ${SCALE_SCENARIO: performance} " == " correctness" ]]; then
@@ -243,14 +295,31 @@ if [[ "${SCALE_SCENARIO:performance}" == "correctness" ]]; then
243295 --skip-regex=" \[Driver:.gcepd\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:([^L].*|L[^o].*|Lo[^a].*|Loa[^d].*)\]\[KubeUp\]" \
244296 --parallel=25
245297else
246- kubetest2 kops " ${KUBETEST2_ARGS[@]} " \
247- --up \
248- --kubernetes-version=" ${K8S_VERSION} " \
249- --create-args=" ${create_args[*]} " \
250- --test=clusterloader2 \
251- -- \
252- --provider=" ${CLOUD_PROVIDER} " \
253- --repo-root=" ${GOPATH} " /src/k8s.io/perf-tests \
254- --kube-config=" ${HOME} /.kube/config" \
255- " ${CLUSTERLOADER2_ARGS[@]} "
298+ if [[ " ${SCALE_TEST_TOOL} " == " kube-burner" ]]; then
299+ kubetest2 kops " ${KUBETEST2_ARGS[@]} " \
300+ --up \
301+ --kubernetes-version=" ${K8S_VERSION} " \
302+ --create-args=" ${create_args[*]} " \
303+ --test=kube-burner \
304+ -- \
305+ " ${KUBE_BURNER_ARGS[@]} "
306+ if [[ -n " ${KUBE_BURNER_REPORT_DIR:- } " ]]; then
307+ mkdir -p " ${ARTIFACTS} /${KUBE_BURNER_REPORT_DIR} "
308+ if ls collected-metrics* 1> /dev/null 2>&1 ; then
309+ mv collected-metrics* " ${ARTIFACTS} /${KUBE_BURNER_REPORT_DIR} /"
310+ echo " Kube-burner locally indexed metrics moved to ${ARTIFACTS} /${KUBE_BURNER_REPORT_DIR} "
311+ fi
312+ fi
313+ else
314+ kubetest2 kops " ${KUBETEST2_ARGS[@]} " \
315+ --up \
316+ --kubernetes-version=" ${K8S_VERSION} " \
317+ --create-args=" ${create_args[*]} " \
318+ --test=clusterloader2 \
319+ -- \
320+ --provider=" ${CLOUD_PROVIDER} " \
321+ --repo-root=" ${GOPATH} " /src/k8s.io/perf-tests \
322+ --kube-config=" ${HOME} /.kube/config" \
323+ " ${CLUSTERLOADER2_ARGS[@]} "
324+ fi
256325fi
0 commit comments