If you need to check hpa
, Horizontal Pod Autoscaling, or throw some chaos at a particular deployment in Kubernetes, then you can 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
Instead, you can 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; accomplished
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 is known as. The next code will let the identify of the deployments obtainable in your cluster:
kubectl get deploy