Wednesday, February 21, 2024
HomeSoftware EngineeringRun a Load Generator on Kubernetes

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 could possibly 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 could possibly 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; performed

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

Step 3 – Discovering your deployment

You’ll be able to swap out the above http://php-apache URL by discovering out what your deployment known as. The next code will let you already know the identify of the deployments obtainable in your cluster:

kubectl get deploy


Please enter your comment!
Please enter your name here

Most Popular

Recent Comments