Exercise 6: Step 3 - Load Test
kubectl run -i --tty load-generator --rm \
--image=busybox --restart=Never -- /bin/sh
for i in $(seq 1 10); do
while true; do wget -q -O- http://practicemanager:8080/q/health/live; done &
done
Alternative: Use a proper load testing tool:
kubectl run -i --tty load-generator --rm \
--image=williamyeh/hey:latest --restart=Never -- \
-z 5m -c 50 http://practicemanager:8080/q/health/live
Watch scaling in another terminal:
kubectl get hpa -w
kubectl top pods -l app=practicemanager
You'll see replicas increase from 2 → 10 as CPU hits 70%!
Note: The & runs each wget loop in background, creating 10 parallel processes.