How to conduct performance testing with Clusterloader2
This document (000020179) is provided subject to the disclaimer at the end of this document.
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
- Clone the perf-test under k8s.io folder:
cd ~/go/src/k8s.io && git clone https://github.com/galal-hussein/perf-tests.git
- Navigate to the clusterloader2 directory:
cd ~/go/src/k8s.io/perf-tests/clusterloader2
- Edit the testconfig according to the environment:
vim testing/load/config.yaml
- Execute the clusterloader2 with appropriate options:
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
- The results of the testing will be stored in the
/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
Further reading
https://github.com/kubernetes/perf-tests
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.