oc cluster up
The oc cluster up command starts a local OpenShift all-in-one cluster with a configured registry, router, image streams, and default templates. By default, the command requires a working Docker connection. However, if running in an environment with Docker Machine installed, it can create a Docker machine for you.
Follow the getting started guide to start the cluster
$PATH
Now type the following:
gofabric8 deploy
As this is using the OpenShift all-in-one cluster we have to update the origin master config so that the fabric8 console can work. These steps are a little fiddly so hopefully we can find a better way to automate this.
get the fabric8 console hostname
oc get -o jsonpath="{.spec.host}" route fabric8
copy the output, should be something like:
fabric8.192.168.99.101.xip.io
SSH to the docker machine that's running openshift and edit the master config
docker-machine ssh openshift
sudo vi /var/lib/origin/openshift.local.config/master/master-config.yaml
add the hostname from above to the list of allowed CORS hostnames, e.g.
corsAllowedOrigins:
- 127.0.0.1
- 192.168.99.101:8443
- localhost
- fabric8.192.168.99.101.xip.io
now restart the origin master from inside the docker-machine:
docker restart origin
oc cluster up suggests to use the developer:developer
username and password to login. If you use this account then you'll need to give it permissions to see the default team that gets created. Easiest way to do this is run:
oc adm policy add-cluster-role-to-user cluster-admin developer
To open the Fabric8 Developer Console then type the following:
open http://$(oc get -o jsonpath="{.spec.host}" route fabric8)
To use docker on your host communicating with the docker daemon inside your OpenShift cluster type:
eval $(docker-machine env openshift)
Check out the troubleshooting guide for more help.