Skip to content

Instantly share code, notes, and snippets.

@nmittler
Created September 8, 2020 17:42
Show Gist options
  • Save nmittler/ea7c3b345edbf893b198f300b5d61078 to your computer and use it in GitHub Desktop.
Save nmittler/ea7c3b345edbf893b198f300b5d61078 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
ARGS=( "${@:1}" )
function sendTraffic()
{
for CTX in "${ARGS[@]}"; do
echo "Sending traffic from cluster $CTX"
for i in {1..10}; do
kubectl exec --context=${CTX} -it -n sample -c sleep \
$(kubectl get pod --context=${CTX} -n sample -l \
app=sleep -o jsonpath='{.items[0].metadata.name}') -- curl \
helloworld.sample.global:5000/hello
done
done
}
# Send traffic from each cluster and log the version.
sendTraffic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment