2016-04-25 17:01:43 +00:00
# Minikube
2016-04-15 22:38:35 +00:00
Run Kubernetes locally
2016-04-19 18:45:58 +00:00
2016-04-25 17:29:07 +00:00
[![Build Status ](https://travis-ci.org/kubernetes/minikube.svg?branch=master )](https://travis-ci.org/kubernetes/minikube)
2016-04-25 17:01:43 +00:00
## Background
Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs
a single-node Kubernetes cluster inside a VM on your laptop for users looking
to try out Kubernetes or develop with it day-to-day.
2016-05-23 21:21:13 +00:00
## Requirements For Running Minikube
* VirtualBox installation
* VT-x/AMD-v virtualization must be enabled in BIOS
2016-06-07 18:12:38 +00:00
## Installation
See the installation instructions for the [latest release ](https://github.com/kubernetes/minikube/releases ).
2016-05-23 21:21:13 +00:00
## Usage
Here's a brief demo of minikube usage. We're using the code from this [Kubernetes tutorial ](http://kubernetes.io/docs/hellonode/ ).
Note that the IP below is dynamic and can change. It can be retrieved with `minikube ip` .
```shell
$ minikube start
Starting local Kubernetes cluster...
Running pre-create checks...
Creating machine...
Starting local Kubernetes cluster...
Kubernetes is available at https://192.168.99.100:443.
2016-05-30 17:19:50 +00:00
$ eval $(minikube docker-env)
2016-05-23 21:21:13 +00:00
$ docker build -t helloworld .
Successfully built d16fe85e1abe
$ kubectl run hello-minikube --image=helloworld --hostport=8000 --port=8080 --generator=run-pod/v1
pod "hello-minikube" created
$ curl http://$(minikube ip):8000
Hello World!
$ minikube stop
Stopping local Kubernetes cluster...
Stopping "minikubeVM"...
```
2016-06-08 00:05:17 +00:00
### Documentation
For a list of minikube's available commands see: [minikube docs ](https://github.com/kubernetes/minikube/blob/master/docs/minikube.md )
2016-05-23 21:21:13 +00:00
2016-06-02 18:13:18 +00:00
### Dashboard
To access the dashboard, run this command in a shell after starting minikube to get the address:
```shell
echo $(minikube ip):$(kubectl get service kubernetes-dashboard --namespace=kube-system -o=jsonpath='{.spec.ports[0].nodePort}{"\n"}')
```
And then copy/paste that into your browser.
2016-05-23 21:21:13 +00:00
## Features
* Minikube packages and configures a Linux VM, Docker and all Kubernetes components, optimized for local development.
* Minikube supports Kubernetes features such as:
* DNS
* NodePorts
* ConfigMaps and Secrets
* Dashboards
## Known Issues
* Features that require a Cloud Provider will not work in Minikube. These include:
* LoadBalancers
* PersistentVolumes
* Ingress
* Features that require multiple nodes. These include:
* Advanced scheduling policies
* DaemonSets
* Alternate runtimes, like rkt.
If you need these features, don't worry! We're planning to add these to minikube over time. Please leave a note in the
issue tracker about how you'd like to use minikube!
2016-04-25 17:01:43 +00:00
## Design
2016-05-23 21:21:13 +00:00
Minikube uses [libmachine ](https://github.com/docker/machine/tree/master/libmachine ) for provisioning VMs, and [localkube ](https://github.com/kubernetes/minikube/tree/master/pkg/localkube ) (originally written and donated to this project by [RedSpread ](https://redspread.com/ )) for running the cluster.
2016-04-25 17:01:43 +00:00
For more information about minikube, see the [proposal ](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/local-cluster-ux.md ).
2016-06-06 17:25:01 +00:00
## Goals and Non-Goals
For the goals and non-goals of the minikube project, please see our [roadmap ](ROADMAP.md ).
2016-04-25 17:08:58 +00:00
2016-05-23 21:21:13 +00:00
## Development Guide
See [CONTRIBUTING.md ](CONTRIBUTING.md ) for an overview of how to send pull requests.
### Build Requirements
2016-05-12 18:44:32 +00:00
2016-05-13 15:35:30 +00:00
* A recent Go distribution (>1.6)
2016-05-12 18:44:32 +00:00
* If you're not on Linux, you'll need a Docker installation
2016-06-04 16:55:51 +00:00
* Minikube requires at least 4GB of RAM to compile, which can be problematic when using docker-machine
2016-04-25 17:08:58 +00:00
2016-05-23 21:21:13 +00:00
### Build Instructions
2016-04-19 18:45:58 +00:00
2016-05-01 15:47:27 +00:00
```shell
2016-05-12 18:44:32 +00:00
make out/minikube
2016-05-01 15:47:27 +00:00
```
2016-04-19 18:45:58 +00:00
2016-05-23 21:21:13 +00:00
### Run Instructions
2016-04-19 18:45:58 +00:00
2016-05-23 21:21:13 +00:00
Start the cluster using your built minikube with:
2016-04-19 18:45:58 +00:00
2016-05-01 15:47:27 +00:00
```shell
2016-05-23 21:21:13 +00:00
$ ./out/minikube start
2016-05-01 15:47:27 +00:00
```
2016-04-19 18:45:58 +00:00
2016-04-30 00:02:00 +00:00
### Running Tests
#### Unit Tests
Unit tests are run on Travis before code is merged. To run as part of a development cycle:
2016-05-01 15:47:27 +00:00
```shell
2016-05-04 21:29:13 +00:00
make test
2016-05-01 15:47:27 +00:00
```
2016-04-30 00:02:00 +00:00
#### Integration Tests
2016-05-01 15:47:27 +00:00
Integration tests are currently run manually.
To run them, build the binary and run the tests:
2016-04-30 00:02:00 +00:00
2016-05-01 15:47:27 +00:00
```shell
2016-05-04 21:29:13 +00:00
make integration
2016-05-01 15:47:27 +00:00
```
2016-05-24 18:29:19 +00:00
#### Conformance Tests
These are kubernetes tests that run against an arbitrary cluster and exercise a wide range of kubernetes features.
You can run these against minikube by following these steps:
* Clone the kubernetes repo somewhere on your system.
* Run `make quick-release` in the k8s repo.
* Start up a minikube cluster with: `minikube start` .
* Set these two environment variables:
```shell
export KUBECONFIG=$HOME/.kube/config
export KUBERNETES_CONFORMANCE_TEST=y
```
* Run the tests (from the k8s repo):
```shell
go run hack/e2e.go -v --test --test_args="--ginkgo.focus=\[Conformance\]" --check_version_skew=false --check_node_count=false
```
2016-06-09 05:33:49 +00:00
### Community
Contributions, questions, and comments are all welcomed and encouraged! minkube developers hang out on [Slack ](https://kubernetes.slack.com ) in the #minikube channel (get an invitation [here ](http://slack.kubernetes.io/ )). We also have the [kubernetes-dev Google Groups mailing list ](https://groups.google.com/forum/#!forum/kubernetes-dev ). If you are posting to the list please prefix your subject with "minikube: ".