Minishift is a tool that helps you run OpenShift locally by running a single-node OpenShift cluster inside a VM. You can try out OpenShift or develop with it, day-to-day, on your local host.
Minishift uses libmachine for provisioning VMs, and OpenShift Origin for running the cluster.
Minishift requires a hypervisor to run the virtual machine containing OpenShift. Depending on your host OS, you have the choice of the following hypervisors:
- OS X
- xhyve (default), VirtualBox or VMware Fusion
- GNU/Linux
- KVM (default) or VirtualBox
- Windows
- Hyper-V (default) or VirtualBox
Make sure that the hypervisor is installed and enabled on your system before you install Minishift.
Important:
- KVM and xhyve require specific installation and configuration steps. For more information, see docker machine drivers installation.
- It is recommended to use
Virtualbox 5.1.12or later on Windows to avoid the issue Error: getting state for host: machine does not exist
If you encounter driver issues, see the Troubleshooting guide.
- Download the archive for your operating system from the Minishift releases page and unpack it.
- Copy the contents of the directory to your preferred location.
- Add the
minishiftbinary to your PATH environment variable.
Note:
- On Windows operating system, due to issue #236, you need to execute the minishift binary from the drive containing your %USERPROFILE% directory.
- Automatic update of the Minishift binary and the virtual machine ISO is currently disabled. See also issue #204
Stable
On OS X you can also use Homebrew Cask to install the stable version of Minishift:
$ brew cask install minishiftLatest Beta
If you want to install the latest beta version of Minishift you will need the homebrew-cask versions tap. After you install homebrew-cask, run the following command:
$ brew tap caskroom/versionsYou can now install the latest beta version of minishift.
$ brew cask install minishift-betaThis section contains a brief demo of Minishift and the provisioned OpenShift cluster. For details on the usage of Minishift refer to the Using Minishift guide. The interaction with OpenShift is via the command line tool oc which is copied to your host.
The following steps describe how to get started with Minishift on a GNU/Linux operating system with the KVM hypervisor driver.
-
Run the
minishift startcommand.$ minishift start Starting local OpenShift cluster using 'kvm' hypervisor... ... OpenShift server started. The server is accessible via web console at: https://192.168.99.128:8443 You are logged in as: User: developer Password: developer To login as administrator: oc login -u system:admin
Note:
- The IP is dynamically generated for each OpenShift cluster. To check the IP, run the
minishift ipcommand. - By default Minishift uses the driver most relevant to the host OS. To use a different driver, set the
--vm-driverflag inminishift start. For example, to use VirtualBox instead of KVM on GNU/Linux operating systems, runminishift start --vm-driver=virtualbox. For more information aboutminishift startoptions, see the minishift start command reference.
-
Add the
ocbinary to the PATH environment variable.$ export PATH=$PATH:~/.minishift/cache/oc/v1.4.1
Note: Depending on the operating system and the oc version, you might need
to use a different command to add oc to the PATH environment variable.
To verify the oc version, check the contents of the ~/.minishift/cache/oc directory.
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.
To deploy the Node.js sample application from the command-line:
-
Create a Node.js example app:
$ oc new-app https://github.com/openshift/nodejs-ex -l name=myapp -
Track the build log until the app is built and deployed using:
$ oc logs -f bc/nodejs-ex -
Expose a route to the service as follows:
$ oc expose svc/nodejs-ex -
Access the app:
$ curl http://nodejs-ex-myproject.192.168.99.128.xip.io -
To stop Minishift, use:
$ minishift stop Stopping local OpenShift cluster... Stopping "minishift"...
When running OpenShift in a single VM, it is recommended to reuse the Docker daemon which Minishift uses for pure Docker use-cases as well. By using the same docker daemon as Minishift, you can speed up your local experiments.
To be able to work with the docker daemon on your Mac or GNU/Linux host use the
docker-env command in your shell:
eval $(minishift docker-env)
You should now be able to use docker on the command line of your host, talking to the docker daemon inside the Minishift VM:
docker ps
The following documentation is available:
- Using Minishift
- Command reference
- Troubleshooting
- Installing docker-machine drivers
- Release Notes
- Developing Minishift
The following features are not supported in Minishift.
- Features that require a Cloud Provider, such as:
- LoadBalancers
- PersistentVolumes
- Ingress
- Features that require multiple nodes, such as advanced scheduling policies
- Alternate runtimes such as
rkt
Minishift is an open-source project dedicated to developing and supporting Minishift. The code base is forked from the Minikube project.
Contributions, questions, and comments are all welcomed and encouraged! Minishift developers hang out on IRC in the #openshift-dev channel on Freenode.
If you want to contribute, make sure to follow the contribution guidelines when you open issues or submit pull requests.
