Learn how to Run a Load Generator on Kubernetes

If you need to check hpa, Horizontal Pod Autoscaling, or throw some chaos at a selected deployment in Kubernetes, then you may run a Load Generator

Step 1 – Run a BusyBox container

The next command will use a busybox container and dump you into it’s shell window:

kubectl run -i --tty load-generator --image=busybox /bin/sh

As a substitute, you may additionally run:

kubectl --generator=run-pod/v1 run -i --tty load-generator --image=busybox /bin/sh

Step 2 – Run a wget loop

Now you can set off a wget loop to make HTTP request calls to your deployment:

whereas true; do wget -q -O - http://php-apache; achieved

The above command makes calls to a php-apache deployment.

Step 3 – Discovering your deployment

You possibly can swap out the above http://php-apache URL by discovering out what your deployment known as. The next code will let you recognize the identify of the deployments accessible in your cluster:

kubectl get deploy

Leave a Reply