Created
July 9, 2019 14:02
-
-
Save mhausenblas/ab076a34343d1fcfed77326a690c99e2 to your computer and use it in GitHub Desktop.
Load generator scripts for NGINX services in ECS and EKS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################################ | |
# Generate load for the NGINXs services in ECS | |
nginxurls=$(ecs-cli ps --desired-status RUNNING | grep nginx | awk '{ split($3, url, "-") ; print(url[1]) }') | |
while true | |
do | |
printf "Hit " | |
for nginxurl in $nginxurls | |
do | |
curl -s $nginxurl > /dev/null | |
printf "$nginxurl " | |
done | |
printf "\n" | |
sleep 2 | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################################ | |
# Generate load for the NGINXs services in EKS | |
# make sure to patch to LB | |
kubectl patch svc nginx -p '{"spec": {"type": "LoadBalancer"}}' | |
# give the LB 3 minutes to be up and running | |
echo "Now waiting for 3min until the load balancer is up ..." | |
sleep 180 | |
echo "Starting to hammer the load balancer:" | |
nginxurl=$(kubectl get svc/nginx -o json | jq .status.loadBalancer.ingress[].hostname -r) | |
while true | |
do | |
printf "Hit " | |
curl -s $nginxurl > /dev/null | |
printf "$nginxurl " | |
printf "\n" | |
sleep 2 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment