How to conduct performance testing with Clusterloader2

Table of Contents

How to conduct performance testing with Clusterloader2

Clusterloader is an opensource performance testing tool to measure the performance metrics of your Kubernetes cluster.


  • Linux or Mac machine that has Golang and kubectl installed
  • SSH key of the Kubernetes master node
  • Kubeconfig file of the target cluster


  1. Create a folder named under ~/go/src/:

    mkdir ~/go/src/
  2. Clone the perf-test under folder:

    cd ~/go/src/ && git clone
  3. Navigate to the clusterloader2 directory:

    cd ~/go/src/
  4. Edit the testconfig according to the environment:

    vim testing/load/config.yaml
  5. 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
  6. The results of the testing will be stored in the /tmp/reports directory.


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:
- Identifier: APIResponsiveness
  Method: APIResponsiveness
    action: reset

Further reading

Was this article helpful?
0 out of 1 found this helpful



Please sign in to leave a comment.