How to conduct performance testing with Clusterloader2
Article Number: 000020179
Situation
How to conduct performance testing with Clusterloader2
Clusterloader is an opensource performance testing tool to measure the performance metrics of your Kubernetes cluster.
Pre-requisites
- Linux or Mac machine that has Golang and kubectl installed
- SSH key of the Kubernetes master node
- Kubeconfig file of the target cluster
Steps
- Create a folder named k8s.io under
~/go/src/
:
mkdir ~/go/src/k8s.io
cd ~/go/src/k8s.io && git clone https://github.com/galal-hussein/perf-tests.git
cd ~/go/src/k8s.io/perf-tests/clusterloader2
vim testing/load/config.yaml
KUBE_SSH_USER=<SSH USERNAME> LOCAL_SSH_KEY=<SSH KEY PATH> go run cmd/clusterloader.go --nodes 3 --mastername=<MASTER NODE NAME> --kubeconfig=<KUBECONFIG FILE PATH> --provider=local --masterip=<MASTER NODE IP ADDRESS> --testconfig=testing/<TESTING SUBJECT>/config.yaml --report-dir=/tmp/reports 2>&1 | tee /tmp/tmp.log
/tmp/reports
directory.
FAQ
Errors: [config reading error: decoding failed: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal number -4611686018427388 into Go struct field Phase.Steps.Phases.ReplicasPerNamespace of type int32]"
- Change the value of
{{$NODES_PER_NAMESPACE := DefaultParam .NODES_PER_NAMESPACE 1}}
to match the number of the nodes in the config.yaml file
level=warning msg="Got errors during step execution: [measurement call APIResponsiveness - APIResponsiveness error: unexpected response: \"# HELP aggregator_openapi_v2_regeneration_count [ALPHA] Counter of OpenAPI v2 spec regeneration count broken down by causing APIService name and reason.
- Comment out the APIResponsiveness section in config.yaml:
measurements:
- Identifier: APIResponsiveness
Method: APIResponsiveness
Params:
action: reset