mirror of
https://github.com/zevenet/kube-nftlb.git
synced 2025-10-27 07:29:25 +00:00
| .. | ||
| charts | ||
| filters | ||
| kubes | ||
| pool | ||
| results | ||
| template | ||
| testdata | ||
| .gitignore | ||
| clean.sh | ||
| expected-rule-count.sh.example | ||
| generate_charts.sh | ||
| generate_pool_data.sh | ||
| README.md | ||
| test.sh | ||
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
Several times (recommended)
# 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
Everything (recommended)
# 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