Virtualization Support:

  • OS X: xhyve (default), VirtualBox, VMware Fusion
  • GNU/Linux: KVM (default), VirtualBox
  • Windows: Hyper-V (default), VirtualBox

The process described in this article is all done under the MacOS X environment

Start the

Command line and parameters

$ minishift start --vm-driver=virtualbox

For well-known reasons, you can use Docker mirroring

$ minishift start --vm-driver=virtualbox --registry-mirror=https://docker.mirrors.ustc.edu.cn

Parameter –vm-driver is available with: VirtualBox, VMwareFusion, Xhyve (default is Xhyve), since VirtualBox is already installed on my system, so select VirtualBox, — Registry – Mirror specifies the address of the public Docker mirror library.

The output

-- Starting local OpenShift cluster using 'virtualbox' hypervisor ... -- Minishift VM will be configured with ... Memory: 2 GB vCPUs : 2 Disk size: 20 GB -- Starting Minishift VM ......................... OK -- Checking for IP address ... OK -- Checking if external host is reachable from the Minishift VM ... Pinging 8.8.8.8... OK -- Checking HTTP connectivity from the VM ... Retrieving http://minishift.io/index.html ... OK -- Checking if persistent storage volume is mounted ... OK -- Checking available disk space ... 0% OK -- OpenShift cluster will be configured with ... Version: V3.6.0 -- Checking 'OC' support for Startup Flags... host-config-dir ... OK host-data-dir ... OK host-pv-dir ... OK host-volumes-dir ... OK routing-suffix ... OK Starting OpenShift using OpenShift/Origin :v3.6.0... Pulling image OpenShift/Origin :v3.6.0 Pulled 1/4 layers, 26% complete Pulled 2/4 layers, Pulling image OpenShift/Origin :v3.6.0 Pulled 1/4 layers, 26% complete Pulled 1/4 layers, 69% complete Pulled 3/4 layers, 77% complete Pulled 4/4 layers, 100% complete Extracting Image pull complete OpenShift server started.

If any errors occur during the process, perform MINISHIFT DELETE to delete the cluster and retry. Resources such as mirror libraries are downloaded during startup and a good network connection is maintained.

theocThe command is added to the PATH

Use the minishift oc-env to print the export command to be added to the PATH:

The export PATH = "/ Users/username /. Minishift/cache/oc/v3.6.0: $PATH" # Run this command to configure your shell: # eval $(minishift oc-env)

Application deployment

Deploy a simple Node.js application

$ oc new-app https://github.com/openshift/nodejs-ex -l name=myapp

To view the log output:

$ oc logs -f bc/nodejs-ex Cloning "https://github.com/openshift/nodejs-ex" ... Commit: 96e651f58aee338e24ea1a170da6d631be1c33da (Merge pull request #143 from bparees/annotations) Author: Ben Parees <[email protected]> Date: Thu Oct 19 14:56:53 2017 +0200 ---> Installing application source ... --> Building your Node application from source NPM WARN deprecated [email protected]: To -iso-string has been deprecated, use @segment/to-iso-string instead. NPM WARN deprecated [email protected]: Jade has been renamed to pug, Please install the latest version of pug instead of jade NPM WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue [email protected] /opt/app-root/ SRC +-- | + -- [email protected] | + -- [email protected] | | ` - [email protected] | ` - [email protected] + - [email protected] | + - [email protected] | + -- [email protected] | | ` - [email protected] | + -- [email protected] | + -- [email protected] | ` - [email protected] + - [email protected] | | + -- [email protected] | + -- [email protected] | + -- [email protected] | | + -- [email protected] | | + -- [email protected] | | | ` - [email protected] | | ` - [email protected] | | ` - [email protected] | + -- + - [email protected] [email protected] | | + -- [email protected] | + -- [email protected] | + -- [email protected] | | + -- [email protected] | | ` - [email protected] | ` - [email protected] + - [email protected] + - [email protected] | + -- [email protected] | | + -- [email protected] | | | ` - [email protected] | | ` - [email protected] | + -- [email protected] | + - [email protected] | | + -- [email protected] | | + -- [email protected] | | | ` - [email protected] | | + -- [email protected] | | + -- [email protected] | | ` - [email protected] | + -- [email protected] | + -- [email protected] | + -- [email protected] | + -- [email protected] | + -- [email protected] | | ` - [email protected] | + -- [email protected] | + -- [email protected] | + - [email protected] | + -- [email protected] | + -- [email protected] | | ` - [email protected] | + -- [email protected] | + -- [email protected] | + -- [email protected] | + -- [email protected] | | ` - [email protected] | + -- [email protected] | + -- [email protected] | + -- [email protected] | | + -- [email protected] | | ` - [email protected] | + -- [email protected] | + -- [email protected] | + -- [email protected] | + -- [email protected] | | + -- [email protected] | | ` - [email protected] | + -- [email protected] + - [email protected] | | + -- [email protected] | + -- [email protected] | | + -- [email protected] | | ` - [email protected] | | ` - [email protected] | + -- [email protected] | ` - [email protected] + - [email protected] | + - + - [email protected] [email protected] | | | ` - [email protected] | + -- [email protected] | + -- [email protected] | + -- [email protected] | | + -- [email protected] | | ` - [email protected] | | + -- [email protected] | | ` - [email protected] | + -- [email protected] | + -- [email protected] | | + -- [email protected] | | ` - [email protected] | + - [email protected] | | ` - [email protected] | + -- [email protected] | ` - [email protected] + - [email protected] | + -- [email protected] | + -- [email protected] | | + - [email protected] | | ` - [email protected] | | + -- [email protected] | | ` - [email protected] | ` - [email protected] | + -- [email protected] | + -- [email protected] | + -- [email protected] | + -- [email protected] | + -- [email protected] | ` - [email protected] + - [email protected] | + -- [email protected] | ` - [email protected] ` - [email protected] Pushing image 172.30.1.1:5000 / reactive - microservices/nodejs - ex: the latest . Pushed 0/9 layers, 17% complete Pushed 1/9 layers, 12% complete Pushed 2/9 layers, 23% complete Pushed 3/9 layers, 34% complete Pushed 4/9 layers, 47% complete Pushed 5/9 layers, 62% complete Pushed 6/9 layers, 73% complete Pushed 7/9 layers, 83% complete Pushed 8/9 layers, 100% complete Pushed 9/9 layers, 100% complete Push successful

View console address

$oc project Using the project "Prometheus - example" on server "https://192.168.99.100:8443".

Then:

https://192.168.99.100:8443– > the browser