k3s/tests/perf/scripts/test

53 lines
1.8 KiB
Plaintext
Raw Normal View History

2019-10-31 21:06:54 +00:00
#!/bin/bash -ex
test_load() {
source scripts/config
2019-11-04 16:09:54 +00:00
eval PRIVATE_KEY_PATH=$PRIVATE_KEY_PATH
EXPANDED_PRIV_KEY_PATH=$(readlink -f $PRIVATE_KEY_PATH)
masterips=$(terraform output -state=server/server.tfstate | grep k3s_server_ips | cut -d "=" -f 2)
2019-10-31 21:06:54 +00:00
pushd tests/
2019-11-04 16:09:54 +00:00
docker run -v $EXPANDED_PRIV_KEY_PATH:/opt/priv_key \
2019-10-31 21:06:54 +00:00
-e KUBE_SSH_USER=ubuntu \
-e LOCAL_SSH_KEY=/opt/priv_key \
-it -v $PWD/:/opt/k3s/perf-tests husseingalal/clusterloader:dev \
clusterloader --testconfig /opt/k3s/perf-tests/load/config.yaml \
--kubeconfig /opt/k3s/perf-tests/kubeconfig.yaml \
--masterip $masterips \
--provider=local \
2019-11-04 16:09:54 +00:00
--report-dir /opt/k3s/perf-tests/load_tests_results-$RANDOM \
2019-10-31 21:06:54 +00:00
--enable-prometheus-server \
--tear-down-prometheus-server=0
popd
}
test_density() {
source scripts/config
2019-11-04 16:09:54 +00:00
eval PRIVATE_KEY_PATH=$PRIVATE_KEY_PATH
EXPANDED_PRIV_KEY_PATH=$(readlink -f $PRIVATE_KEY_PATH)
masterips=$(terraform output -state=server/server.tfstate | grep k3s_server_ips | cut -d "=" -f 2)
2019-10-31 21:06:54 +00:00
pushd tests/
docker run -e KUBE_SSH_USER=ubuntu \
2019-11-04 16:09:54 +00:00
-v $EXPANDED_PRIV_KEY_PATH:/opt/priv_key \
2019-10-31 21:06:54 +00:00
-e LOCAL_SSH_KEY=/opt/priv_key \
-it -v $PWD/:/opt/k3s/perf-tests husseingalal/clusterloader:dev \
clusterloader --testconfig /opt/k3s/perf-tests/density/config.yaml \
--kubeconfig /opt/k3s/perf-tests/kubeconfig.yaml \
--masterip $masterips \
--provider=local \
2019-11-04 16:09:54 +00:00
--report-dir /opt/k3s/perf-tests/density_tests_results-$RANDOM \
2019-10-31 21:06:54 +00:00
--enable-prometheus-server \
--tear-down-prometheus-server=0
popd
}
clean() {
# clean kubeconfig
pushd tests/
rm -f kubeconfig
2019-11-04 16:09:54 +00:00
rm -rf load_tests_results*
2019-10-31 21:06:54 +00:00
rm -rf density_tests_results/
popd
}
$@