Performing loadtests require lot of effort and preperation, inorder to generate traffic similar to production environment a distributed load generation tool would have to be used. Locust is a very popular load generation tool which supports writing test cases in python. The purpose of this project is to provide ready to use solution of locust.io for performing distributed load testing.
Locust Operator supports two different deployments setups for locust.
- cluster: creates a single master with multiple workers.
- standalone: only master instance of locust created.
make apply-resources
make create-crd
kubectl get pods
NAME READY STATUS RESTARTS AGE
locust-operator-5fb99cfd9b-k5w4b 1/1 Running 0 118s
Deployment of locust master only
apiVersion: locustload.cndev.io/v1alpha1
kind: Locust
metadata:
name: example-locust
spec:
image: amilaku/locust:v0.0.1
hosturl: https://postman-echo.com
Distributed locust deployment with workers
apiVersion: locustload.cndev.io/v1alpha1
kind: Locust
metadata:
name: example-locust
spec:
slaves: 2
image: amilaku/locust:v0.0.1
hosturl: https://postman-echo.com
- Autoscale locust workers with HPA.
- Load Generation per given rate.
- Prescale application deployments in a Kubernetes cluster before starting load test.
- Generate Report
commands
make build-img
make push-img