Skip to content

A command-line tool for managing Locust distributed load testing on Kubernetes.

License

Notifications You must be signed in to change notification settings

YoungJinJung/klocust

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

klocust

Klocust is a command-line tool for managing Locust distributed load testing on Kubernetes.

Installation

Required

  • kubernetes version 1.16 or higher
  • kubeconfig for connect to your k8s cluster

Recommend

  • Ingress Controller
    exposes your locust cluster to outside of the k8s cluster. (internal or internet-facing)
  • ExternalDNS
    create(update) and delete domain for your locust cluster automatically.

Install klocust binary

$ brew tap DevopsArtFactory/devopsart
$ brew update
$ brew install klocust 
$ klocust version
0.0.1

Build from source

shell autocompletion for bash/zsh

echo 'source <(kubectl completion bash)' >>~/.bashrc
or
echo 'source <(kubectl completion zsh)' >>~/.zsh

Usages

klocust list

  • Display all of Locust clusters
$ klocust list

>>> 1 locust deployments in loadtest namespace. (PREFIX: locust-main-)
+-------+---------------------+-------+------------+-----------+------+
| NAME  | DEPLOYMENT          | READY | UP-TO-DATE | AVAILABLE | AGE  |
+-------+---------------------+-------+------------+-----------+------+
| hello | locust-main-hello   | 1/1   | 1          | 1         | 9m5s |
+-------+---------------------+-------+------------+-----------+------+

klocust init

  • Create config & locust files before applying. (ex name: hello)
$ klocust init hello

Update config & locust files

  • Update config & locust files what you need. (ex name: hello)
$ vi hello-klocust.yaml
$ vi hello-locustfile.py
  • If you want test locust in your local environments
$ docker run -p 8089:8089 -v $PWD:/mnt/locust locustio/locust -f /mnt/locust/hello-locustfile.py

or 

$ pip3 install locust
$ locust -f hello-locustfile.py

klocust apply

  • Create or Update locust cluster with config & locust files. (ex name: hello)
$ klocust apply hello
  • Connect to your locust cluster and do load testing.
    (ex name: hello)
$ open https://locust-hello.{your domain}

klocust delete

  • Delete locust cluster (ex name: hello)
$ klocust delete hello

Contribution Guide

About

A command-line tool for managing Locust distributed load testing on Kubernetes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 68.5%
  • Shell 14.3%
  • Python 9.3%
  • Makefile 5.1%
  • Dockerfile 2.8%