Skip to content

Instantly share code, notes, and snippets.

@georgegoh
Created September 11, 2019 10:17
Show Gist options
  • Select an option

  • Save georgegoh/197c070a2b01e9f3fefb03fa1df7b3de to your computer and use it in GitHub Desktop.

Select an option

Save georgegoh/197c070a2b01e9f3fefb03fa1df7b3de to your computer and use it in GitHub Desktop.
#!/bin/sh
######## MODIFY THE FOLLOWING TO SUIT YOUR TESTS ####################
export MAX_SVC=3
export POD_PORT=9376
export IMAGE=gcr.io/google_containers/serve_hostname:1.3
################# NO MODIFICATION AFTER THIS LINE ###################
# TO DELETE RESOURCES CREATED BY THIS SCRIPT, RUN:
#
# oc delete all -l purpose=harness
#
#####################################################################
for i in `seq 1 ${MAX_SVC}`;do
echo "creating service number $i"
oc run test$i --image=${IMAGE} --expose=true --port=${POD_PORT} > /dev/null 2>&1
oc label dc test$i purpose=harness > /dev/null 2>&1
oc label service test$i purpose=harness > /dev/null 2>&1
oc expose service test$i > /dev/null 2>&1
done
echo "Done."
echo "====="
echo
echo "Use the following routes:"
oc get route -l purpose=harness -o jsonpath='{range .items[*]}{.spec.host}{"\n"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment