Minishift Quickstart

Overview

This section contains a brief demo of Minishift and of the provisioned OpenShift cluster. For details on the usage of Minishift, see the Basic Usage section.

The interaction with OpenShift is with the command line tool oc which is copied to your host. For more information on how Minishift can assist you in interacting with and configuring your local OpenShift instance, see the OpenShift Client Binary section.

For more information about the OpenShift cluster architecture, see Architecture Overview in the OpenShift documentation.

The following steps describe how to get started with Minishift on a Linux operating system with the KVM hypervisor driver.

Starting Minishift

  1. Run the minishift start command:

    1. $ minishift start
    2. -- Starting local OpenShift cluster using 'kvm' hypervisor...
    3. ...
    4. OpenShift server started.
    5. The server is accessible via web console at:
    6. https://192.168.99.128:8443
    7. You are logged in as:
    8. User: developer
    9. Password: developer
    10. To login as administrator:
    11. oc login -u system:admin
    • The IP is dynamically generated for each OpenShift cluster. To check the IP, run the minishift ip command.

    • By default, Minishift uses the driver most relevant to the host OS. To use a different driver, set the —vm-driver flag in minishift start. For example, to use VirtualBox instead of KVM on Linux operating systems, run minishift start —vm-driver=virtualbox.

    • While Minishift starts it runs several checks to make sure that the Minishift VM and the OpenShift cluster are able to start correctly. If any startup checks fail, see the Troubleshooting Getting Started topic for information about possible causes and solutions.

    For more information about minishift start options, see the minishift start command.

  2. Use minishift oc-env to display the command you need to type into your shell in order to add the oc binary to your PATH environment variable. The output of oc-env will differ depending on OS and shell type.

    1. $ minishift oc-env
    2. export PATH="/home/john/.minishift/cache/oc/v1.5.0:$PATH"
    3. # Run this command to configure your shell:
    4. # eval $(minishift oc-env)

For more information about interacting with OpenShift with the command line interface and the Web console, see the OpenShift Client Binary section.

Deploying a Sample Application

OpenShift provides various sample applications, such as templates, builder applications, and quickstarts. The following steps describe how to deploy a sample Node.js application from the command line.

  1. Create a Node.js example app:

    1. $ oc new-app https://github.com/sclorg/nodejs-ex -l name=myapp
  2. Track the build log until the app is built and deployed:

    1. $ oc logs -f bc/nodejs-ex
  3. Expose a route to the service:

    1. $ oc expose svc/nodejs-ex
  4. Access the application:

    1. $ minishift openshift service nodejs-ex --in-browser
  5. To stop Minishift, use the following command:

    1. $ minishift stop
    2. Stopping local OpenShift cluster...
    3. Stopping "minishift"...

For more information about creating applications in OpenShift, see Creating New Applications in the OpenShift documentation.