Skip to content

Instantly share code, notes, and snippets.

@crobby
Last active January 16, 2017 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crobby/acba41a1524f970bb15cb10d5326fc9f to your computer and use it in GitHub Desktop.
Save crobby/acba41a1524f970bb15cb10d5326fc9f to your computer and use it in GitHub Desktop.
Fast way to get oshinko up and running on a basic openshift single node cluster
# Start up an OpenShift Origin cluster locally
oc cluster up
# Authorize Oshinko service account to write to the OpenShift API
oc create sa oshinko
oc policy add-role-to-user edit -z oshinko
# Launch Oshinko in the current project
oc new-app -f ui-template-no-route.yaml
# Wait for your app to come up, then find the pod name where oshinko-webui is running
# then execute oc port-forward <pod name> <local port>:8080
# to forward all traffic on localhost:<local port> to the webui
WEBPOD=""
while [ "$WEBPOD" == "" ]
do
sleep 2
STATUS=$(oc get pods -o jsonpath --selector='name=oshinko-web' --no-headers --template='{.items[*].status.phase}')
if [ "$STATUS" == "Running" ]; then
WEBPOD=$(oc get pods -o jsonpath --selector='name=oshinko-web' --no-headers --template='{.items[*].metadata.name}')
fi
done
echo "Forwarding localhost 8080 to the oshinko-webui pod: http://localhost:8080"
oc port-forward $WEBPOD 8080:8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment