In latest openshiftÂ client (oc) there is a nifty (relatively) new feature to get youÂ aÂ OpenShiftÂ clusterÂ starting (very) quickly. It’s a pretty nice way to get you a new openshiftÂ originÂ environmentÂ on your laptopÂ Â without the hassle.
On macosx there is a (as well relatively) new lightweightÂ virtualization solution called xhyveÂ it’s a bit like KVM in the sense of being lightweight and does not need like virtualbox or vmware to get a UI running. It seemed to be a perfect fit to try those two together.
xhyve docker machine driver needed to be installed firstÂ so I just went on its website here :
and followed the installation instruction from the READMEÂ whichÂ IÂ couldÂ see everything was workingÂ :
I then fired up the “oc cluster up –create-machine” command and to my disappointment it was starting by defaultÂ the virtualbox and I could not see anything in theÂ options how to specify the “–driver xhyve” option to docker-machine which is what the oc cluster feature is using on the backend to bootstrap a docker environment.
Digging into the code it seemsÂ that theÂ oc clusterÂ has those feature set in static as virtualbox :
sinceÂ there was no way to pass other options I first looked in the github issues to see if there was nothing reportedÂ about it andÂ sent a feature request here,
I started to think a little bit more about a workaroundÂ going fromÂ modifying to my liking and recompiling the ocÂ client or to just give up on xhyve but in fact the solution is actually much simplier.
Since thereÂ is the abilityÂ to specify to “oc cluster up” an already configured docker-machine environment with the “Â –docker-machine” option. We just had to configured previously properlyÂ first (which is with the option –engine-insecure-registry 172.30.0.0/16) :
and after a bit the new docker shouldÂ be setup which can be easily used with the command eval $(docker-machine env xhyve)
I then just have to start my oc cluster up with the optionÂ Â –docker-machine=”xhyve” and I would get my nicely setuped openshift origin cluster to play with in mere seconds :