|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "Getting started with Minishift" |
| 4 | +date: 2018-08-05 09:40:49 -0500 |
| 5 | +categories: minishift |
| 6 | +tags: DevOps minishift |
| 7 | +--- |
| 8 | + |
| 9 | +## Install minishift on Mac |
| 10 | + |
| 11 | +*** |
| 12 | + |
| 13 | +### Setting Up xhyve Driver |
| 14 | + |
| 15 | +xhyve hypervisor is used by minishift for MacOS. Following is the setps on how to install xhyve driver on MacOS |
| 16 | + |
| 17 | +Use the following command to install the latest version of the driver with Homebrew: |
| 18 | + |
| 19 | + |
| 20 | +`$ brew install docker-machine-driver-xhyve` |
| 21 | + |
| 22 | +Once installed, enable root access for the docker-machine-driver-xhyve binary and add it to the default wheel group: |
| 23 | + |
| 24 | +`$ sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve` |
| 25 | +Set the owner User ID (SUID) for the binary as follows: |
| 26 | + |
| 27 | +`$ sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve` |
| 28 | + |
| 29 | +Verify that xhyve driver is installed successfully |
| 30 | + |
| 31 | +`brew info --installed docker-machine-driver-xhyve` |
| 32 | + |
| 33 | +*** |
| 34 | + |
| 35 | +### Install minishift |
| 36 | +After the xhyve driver is installed and verified, install minishift |
| 37 | + |
| 38 | +`$ brew cask install minishift` |
| 39 | + |
| 40 | +### Starting Minishift |
| 41 | +After minishift is installed, start minishift |
| 42 | + |
| 43 | +` minishift start` |
| 44 | + |
| 45 | +If minishift starts successfully, you will see output similar to the follow: |
| 46 | + |
| 47 | +``` |
| 48 | +Using 192.168.64.2 as the server IP |
| 49 | +Starting OpenShift using openshift/origin:v3.9.0 ... |
| 50 | +OpenShift server started. |
| 51 | +
|
| 52 | +The server is accessible via web console at: |
| 53 | + https://192.168.64.2:8443 |
| 54 | +``` |
| 55 | + |
| 56 | +Note that the ip is random choose and you can get the ip address of the vm using: |
| 57 | + |
| 58 | +`minishift ip` |
| 59 | + |
| 60 | +After minishift started, you can access the web console at: |
| 61 | + |
| 62 | +https://<minishift_ip_address>:8443. In above case, it would be https://192.168.64.2:8443. |
| 63 | + |
| 64 | +The default username `developer` and the default password is `developer` |
| 65 | + |
| 66 | +You can also login to the openshift command line: |
| 67 | + |
| 68 | +`oc login https://<minishift_ip_address>:8443/ -u developer -p developer` |
| 69 | + |
| 70 | +You can create an example app using: |
| 71 | + |
| 72 | +`oc new-app https://github.com/openshift/nodejs-ex -l name=myapp` |
| 73 | + |
| 74 | +You can track the log using: |
| 75 | + |
| 76 | +`oc logs -f bc/nodejs-ex` |
| 77 | + |
| 78 | +After the build is finished, a new service should get started. You can list the service using |
| 79 | + |
| 80 | +`oc get service` |
| 81 | + |
| 82 | +This service is not exposed yet, you can expose the service using: |
| 83 | + |
| 84 | +`oc expose svc/nodejs-ex` |
| 85 | + |
| 86 | +this command will create a new route in openshift to allow external traffic to the service. You get verify the route got created using |
| 87 | + |
| 88 | +`oc get routes` |
| 89 | + |
| 90 | +HOST is where the host where the service is exposed at. |
| 91 | + |
| 92 | +For example |
| 93 | + |
| 94 | +``` |
| 95 | +$ oc get routes |
| 96 | +NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD |
| 97 | +nodejs-ex nodejs-ex-myproject.192.168.64.2.nip.io nodejs-ex 8080-tcp None |
| 98 | +``` |
| 99 | + |
| 100 | +In this case, nodejs-ex-myproject.192.168.64.2.nip.io is the endpoint the service is exposed. |
| 101 | + |
| 102 | + |
| 103 | +Reference: |
| 104 | +[okd documentation](https://docs.okd.io/latest/minishift/getting-started/quickstart.html#starting-minishift) |
0 commit comments