README.md 5.0 KB
Newer Older
D
Dan Lorenc 已提交
1 2
# Minikube

V
Vish Kannan 已提交
3
Run Kubernetes locally
D
dlorenc 已提交
4

D
Dan Lorenc 已提交
5 6
[![Build Status](https://travis-ci.org/kubernetes/minikube.svg?branch=master)](https://travis-ci.org/kubernetes/minikube)

D
Dan Lorenc 已提交
7 8 9 10 11 12
## 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.

13
## Requirements For Running Minikube
14
* [VirtualBox](https://www.virtualbox.org/wiki/Downloads) or [VMware Fusion](https://www.vmware.com/products/fusion) installation
15 16
* VT-x/AMD-v virtualization must be enabled in BIOS

17 18 19
## Installation
See the installation instructions for the [latest release](https://github.com/kubernetes/minikube/releases).

20 21
## Usage

22
Here's a brief demo of minikube usage.
23 24
If you want to change the VM driver to VMware Fusion add the `--vm-driver=vmwarefusion` flag to `minikube start`.

25 26 27 28 29 30 31 32 33 34
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.

35 36
$ kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --hostport=8000 --port=8080
deployment "hello-minikube" created
37
$ curl http://$(minikube ip):8000
38 39 40 41 42
CLIENT VALUES:
client_address=192.168.99.1
command=GET
real path=/
...
43 44 45 46
$ minikube stop
Stopping local Kubernetes cluster...
Stopping "minikubeVM"...
```
47 48
### Documentation
For a list of minikube's available commands see: [minikube docs](https://github.com/kubernetes/minikube/blob/master/docs/minikube.md)
49

50 51
### Dashboard

52
To open the dashboard, run this command in a shell after starting minikube:
D
Dan Lorenc 已提交
53
To access the [Kubernetes Dashboard](http://kubernetes.io/docs/user-guide/ui/), run this command in a shell after starting minikube to get the address:
54
```shell
55
minikube dashboard
56 57
```

58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
## 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!

D
Dan Lorenc 已提交
79 80
## Design

81
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.
D
Dan Lorenc 已提交
82 83 84

For more information about minikube, see the [proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/local-cluster-ux.md).

D
dlorenc 已提交
85 86
## Goals and Non-Goals
For the goals and non-goals of the minikube project, please see our [roadmap](ROADMAP.md).
D
Dan Lorenc 已提交
87

88 89 90 91 92
## Development Guide

See [CONTRIBUTING.md](CONTRIBUTING.md) for an overview of how to send pull requests.

### Build Requirements
93

D
Dan Lorenc 已提交
94
* A recent Go distribution (>1.6)
95
* If you're not on Linux, you'll need a Docker installation
96
* Minikube requires at least 4GB of RAM to compile, which can be problematic when using docker-machine
D
Dan Lorenc 已提交
97

98
### Build Instructions
D
dlorenc 已提交
99

100
```shell
101
make out/minikube
102
```
D
dlorenc 已提交
103

104
### Run Instructions
D
dlorenc 已提交
105

106
Start the cluster using your built minikube with:
D
dlorenc 已提交
107

108
```shell
109
$ ./out/minikube start
110
```
D
dlorenc 已提交
111

112 113 114 115 116 117
### Running Tests

#### Unit Tests

Unit tests are run on Travis before code is merged. To run as part of a development cycle:

118
```shell
119
make test
120
```
121 122 123

#### Integration Tests

124 125
Integration tests are currently run manually. 
To run them, build the binary and run the tests:
126

127
```shell
128
make integration
129
```
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147

#### 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
```
148 149 150 151

### 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: ".