zevenet-kube-nftlb/tests/performance
2020-11-03 08:21:11 +01:00
..
charts [Improvement] Refactored tests, easier to understand 2020-10-26 10:10:46 +01:00
filters [Improvement] Refactored tests, easier to understand 2020-10-26 10:10:46 +01:00
kubes [Improvement] Update daemonset config for tests 2020-11-03 08:18:49 +01:00
pool [Improvement] Refactored tests, easier to understand 2020-10-26 10:10:46 +01:00
results [Improvement] Refactored tests, easier to understand 2020-10-26 10:10:46 +01:00
template [Improvement] Refactored tests, easier to understand 2020-10-26 10:10:46 +01:00
testdata [Improvement] Refactored tests, easier to understand 2020-10-26 10:10:46 +01:00
.gitignore [Improvement] Refactored tests, easier to understand 2020-10-26 10:10:46 +01:00
clean.sh [Improvement] Refactored tests, easier to understand 2020-10-26 10:10:46 +01:00
expected-rule-count.sh.example [Improvement] Refactored tests, easier to understand 2020-10-26 10:10:46 +01:00
generate_charts.sh [Improvement] Refactored tests, easier to understand 2020-10-26 10:10:46 +01:00
generate_pool_data.sh [Improvement] Refactored tests, easier to understand 2020-10-26 10:10:46 +01:00
README.md [Improvement] Refactored tests, easier to understand 2020-10-26 10:10:46 +01:00
test.sh [Bug fix] Replace kubectl wait command for deployments 2020-11-03 08:21:11 +01:00

tests/performance

Requirements

  • gnuplot (to make benchmark charts)
root@debian:~# apt-get install gnuplot

Setup scripts

# Copy and rename expected-rule-count.sh
root@debian:kube-nftlb/tests/performance# cp expected-rule-count.sh.example expected-rule-count.sh

# Give them execute permissions
root@debian:kube-nftlb/tests/performance# chmod +x *.sh

Get expected rule count

⚠ Edit expected-rule-count.sh before continuing. This must be done for every file in kubes/, because counting rules can differ between each kube. Read test.sh to know already defined functions for this.

# Pass your kube-test file as the first parameter (this is an example)
root@debian:kube-nftlb/tests/performance# ./expected-rule-count.sh ./kubes/kube-test.yaml
# To specify a single (or several) deployment(s), pass them after specifying the first parameter (this is an example)
root@debian:kube-nftlb/tests/performance# ./expected-rule-count.sh ./kubes/kube-test.yaml ./testdata/deployments/resource-test.yaml ./testdata/deployments/resource-test-2.yaml

Test resources

Only once

# Save your results by piping the output to a file
root@debian:kube-nftlb/tests/performance# ./test.sh > results/your-test.txt
# Set how many times the tests will be run by changing REPEATS
root@debian:kube-nftlb/tests/performance# REPEATS=5 ; for i in $(seq 1 $REPEATS) ; do ./test.sh > "results/your-test-$i.txt" ; done

Filter results

Individually

# Beware, this will edit your file! If you only want to see the filtered output, remove the "-i" flag
root@debian:kube-nftlb/tests/performance# sed -i -f filters/result.sed results/your-result.txt
# Save your filtered results by piping the output to a file
root@debian:kube-nftlb/tests/performance# sed -f filters/result.sed results/* > filtered-results.txt

Make benchmark charts

filtered-results.txt is required.

# A filepath with all your filtered results must be specified as first parameter
root@debian:kube-nftlb/tests/performance# ./generate_pool_data.sh filtered-results.txt

# Two daemonset *names* must be specified as parameters
root@debian:kube-nftlb/tests/performance# ./generate_charts.sh kube-test-1 kube-test-2

Clean resources

If anything goes wrong, you can run this script to clean every deployment, service or daemonset pending.

root@debian:kube-nftlb/tests/performance# ./clean.sh