Skip to content

Instantly share code, notes, and snippets.

@karlkfi
Created November 10, 2015 00:03
Show Gist options
  • Save karlkfi/0e3170dff4e5d6e9e951 to your computer and use it in GitHub Desktop.
Save karlkfi/0e3170dff4e5d6e9e951 to your computer and use it in GitHub Desktop.
Populate Oinker with oinks
#!/usr/bin/env bash
set -e
set -o nounset
KUBE_UI=$(dcos kubectl cluster-info | grep "KubeUI" | cut -d " " -f 5 | sed -e 's,/api,/service/kubernetes/api,')
KUBE_UI=$(echo $KUBE_UI | sed $'s,\x1b\\[[0-9;]*[a-zA-Z],,g')
#echo $KUBE_UI
OINKER=$(echo $KUBE_UI | sed -e 's/kube-system/default/' | sed -e 's/kube-ui/oinker/')
#echo $OINKER
for i in $(seq 1 50); do
data="handle=MrNumber$(($i % 5))&content=yadda-yadda-yadda-${i}"
echo "POST: ${data}"
wget -O- \
--post-data="${data}" \
"${OINKER}/oink" &> /dev/null
done
@karlkfi
Copy link
Author

karlkfi commented Nov 10, 2015

Assumes you have Oinker deployed on Kubernetes on Mesos in DCOS.
Assumes dcos-cli is already installed and the kubectl plugin is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment