Skip to content

Built to run on Kubernetes, this service is designed to test the performance of given applications using locust

License

Notifications You must be signed in to change notification settings

JadKHaddad-2/Rust-Performance-Testing-as-a-Service

 
 

Repository files navigation

Performace Testing as a Service

Built to run on Kubernetes, this service is designed to test the performance of given applications using locust

Deployment using MicroK8s

  • Use the project's root directory as your working directory

  • Enable the necessary MicroK8s oddons

microk8s enable dns registry ingress metallb
  • MicroK8s' default local registry's port is, 32000

  • Build the helper images

docker build -t builder:latest -f Dockerfiles/Dockerfile.builder .
docker build -t runner:latest -f Dockerfiles/Dockerfile.runner .
  • Build the images and push them to the local registry
docker build -t localhost:32000/master-release:latest -f Dockerfiles/Dockerfile.master-release .
docker push localhost:32000/master-release:latest
docker build -t localhost:32000/worker-release:latest -f Dockerfiles/Dockerfile.worker-release .
docker push localhost:32000/worker-release:latest
docker build -t localhost:32000/frontend:latest -f Dockerfiles/Dockerfile.frontend .
docker push localhost:32000/frontend:latest
  • Create the namespace
kubectl create namespace performance-testing
  • Make things easier by setting kubectl's default namespace
kubectl config set-context --current --namespace=performance-testing
  • Apply kubernetes yaml files
kubectl apply -f Kubernetes/pv-volume.yaml
kubectl apply -f Kubernetes/pv-claim.yaml
kubectl apply -f Kubernetes/configmap.yaml
kubectl apply -f Kubernetes/redis.yaml
kubectl apply -f Kubernetes/frontend.yaml
kubectl apply -f Kubernetes/master.yaml
kubectl apply -f Kubernetes/worker-1.yaml
kubectl apply -f Kubernetes/worker-2.yaml
kubectl apply -f Kubernetes/worker-loadbalancer.yaml
kubectl apply -f Kubernetes/ingress.yaml
  • Add more workers by using the WorkerCreator
python3 Kubernetes/WorkerCreator/app.py 3

kubectl apply -f Kubernetes/worker-3.yaml
  • Depending on your use case and kubernetes distribution, you may edit Kubernetes/pv-volume.yaml and Kubernetes/ingress.yaml

  • MicroK8s's default ingress' port is, 80

  • After building new images, reapply the deployments

# kubectl rollout restart -n <namespace> deployment <deployment>

kubectl rollout restart deployment -n performance-testing frontend-deployment
kubectl rollout restart deployment -n performance-testing master-deployment
kubectl rollout restart deployment -n performance-testing worker-1-deployment
kubectl rollout restart deployment -n performance-testing worker-2-deployment

...
  • Master and Worker images are built to run as non root users
  • Local persistant volumes do not support mounting a directory with non root permissions
  • If you wish to use another persistant volume type, please make sure to edit the securityContext configurations in Kubernetes/master.yaml, Kubernetes/worker-<worerk_num>.yaml and Kubernetes/WorkerCreator/template.yaml
...
spec:
  ...
  template:
    ...
    spec:
      securityContext:
        runAsUser: 101
        runAsGroup: 101
        fsGroup: 101
    ...
...

Architecture

architecture

Contributors

License & copyright

© 2022 Jad K. Haddad Licensed under the MIT License

Todo

  • Locust does not stop if host is not valid
  • Stop test before download, or create new zip on every request
  • Other features.

About

Built to run on Kubernetes, this service is designed to test the performance of given applications using locust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 74.9%
  • Vue 17.3%
  • CSS 3.8%
  • Python 1.8%
  • JavaScript 1.1%
  • HTML 1.0%
  • Ruby 0.1%