How to Run a Load Generator on Kubernetes

0 min read 153 words

If you would like to test hpa, Horizontal Pod Autoscaling, or throw some chaos at a specific deployment in Kubernetes , then you could run a Load Generator

Step 1 – Run a BusyBox container

The following 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 an alternative, you could also run:

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

Step 2 – Run a wget loop

You can now trigger a wget loop to make HTTP request calls to your deployment:

while true; do wget -q -O - http://php-apache; done

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

Step 3 – Finding your deployment

You can swap out the above http://php-apache URL by finding out what your deployment is called. The following code will let you know the name of the deployments available in your cluster:

kubectl get deploy
Andrew
Andrew

Andrew is a visionary software engineer and DevOps expert with a proven track record of delivering cutting-edge solutions that drive innovation at Ataiva.com. As a leader on numerous high-profile projects, Andrew brings his exceptional technical expertise and collaborative leadership skills to the table, fostering a culture of agility and excellence within the team. With a passion for architecting scalable systems, automating workflows, and empowering teams, Andrew is a sought-after authority in the field of software development and DevOps.

Tags