Run a local kubernetes cluster on your machine with minikube
Posted on February 27, 2017
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.
Features
Minikube packages and configures a Linux VM, the container runtime, and all Kubernetes components, optimized for local development.
Minikube supports Kubernetes features such as:
- DNS
- NodePorts
- ConfigMaps and Secrets
- Dashboards
- Container Runtime: Docker, and rkt
- Enabling CNI (Container Network Interface)
Requirements
- OS X: xhyve driver, Virtualbox or VMware Fusion
- Linux: Virtualbox or KVM
- Windows: Hyper-V
- VT-x/AMD-v virtualization must be enabled in BIOS
Installation
Install the minikube commandline.
$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.16.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
Using minikube
Start minkube with specific driver:
$ minikube start --vm-driver [virtualbox xhyve vmwarefusion] (default "virtualbox")
Starting local Kubernetes cluster...
Running pre-create checks...
Creating machine...
Starting local Kubernetes cluster...
Start kubernetes POD’s
$ kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080
Stop minikube
$ $ minikube stop
Stopping local Kubernetes cluster...
Stopping "minikube"...