Skip to content

Instantly share code, notes, and snippets.

@vpavlin
Last active February 21, 2017 10:51
Show Gist options
  • Save vpavlin/578b9167903e41c60f702a4e4f9809aa to your computer and use it in GitHub Desktop.
Save vpavlin/578b9167903e41c60f702a4e4f9809aa to your computer and use it in GitHub Desktop.

First of all....

sudo setenforce 0
MYIP=<insert_ip_of_the_machine_running_your_cluster_here>

Bring the cluster up, make developer cluster admin and deploy

sudo oc luster up --public-hostname=$MYIP.xip.io --routing-suffix=$MYIP.xip.io
sudo docker exec -it origin oadm policy add-cluster-role-to-user cluster-admin developer
TOKEN=`curl -k -L -D - -u developer:developer -H 'X-CSRF-Token: 1' 'https://$MYIP.xip.io:8443/oauth/authorize?response_type=token&client_id=openshift-challenging-client' 2>&1 | grep -oP "access_token=\K[^&]*"`
oc login https://$MYIP.xip.io:8443/ --token=$TOKEN
gofabric8 --server https://$MYIP.xip.io:8443/ --token $TOKEN --domain $MYIP.xip.io deploy

This is probably gonna hang, so kill it and run

gofabric8 volumes
sudo chmod -R 777 /data/default

A coffee later, you should be able to view components of fabric8 in your browser

oc get routes

Notes:

###Memory consumption by containers

for id in `sudo docker ps | grep default | grep -v origin | awk '{print $1"|"$2}'`; do echo -n ${id##*|}" "; systemd-cgtop -p | grep docker | sed 's/  */ /g' | cut -d" " -f 1,4 | grep ${id%%|*}; done

or docker stats

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