Name: minikube
Owner: LinuxONE and Linux on z Systems Open-source Team
Description: Run Kubernetes locally
Created: 2018-05-15 11:08:41.0
Updated: 2018-05-15 11:08:44.0
Pushed: 2018-05-25 09:02:03.0
Homepage: null
Size: 49572
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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.
cask install minikube
-Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
Download the minikube-windows-amd64.exe file, rename it to minikube.exe
and add it to your path.
Example with kubectl installation:
-Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube
-Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl
rt MINIKUBE_WANTUPDATENOTIFICATION=false
rt MINIKUBE_WANTREPORTERRORPROMPT=false
rt MINIKUBE_HOME=$HOME
rt CHANGE_MINIKUBE_NONE_USER=true
r $HOME/.kube || true
h $HOME/.kube/config
rt KUBECONFIG=$HOME/.kube/config
-E ./minikube start --vm-driver=none
is for loop waits until kubectl can access the api server that Minikube has created
i in {1..150}; do # timeout for 5 minutes
/kubectl get po &> /dev/null
f [ $? -ne 1 ]; then
break
eep 2
bectl commands are now able to interact with Minikube cluster
The asdf tool offers version management for a wide range of languages and tools. On macOS, asdf is available via Homebrew and can be installed with brew install asdf
. Then, the Minikube plugin itself can be installed with asdf plugin-add minikube
. A specific version of Minikube can be installed with asdf install minikube <version>
. The tool allows you to switch versions for projects using a .tool-versions
file inside the project. An asdf plugin exists for kubectl as well.
We also released a Debian package and Windows installer on our releases page. If you maintain a Minikube package, please feel free to add it here.
--vm-driver=none
option that runs the Kubernetes components on the host and not in a VM. Docker is required to use this driver but no hypervisor. If you use --vm-driver=none
, be sure to specify a bridge network for docker. Otherwise it might change between network restarts, causing loss of connectivity to your cluster.Here's a brief demo of Minikube usage.
If you want to change the VM driver add the appropriate --vm-driver=xxx
flag to minikube start
. Minikube supports
the following drivers:
nikube start
ting local Kubernetes v1.7.5 cluster...
ting VM...
ing files into VM...
ing up certs...
ting cluster components...
ecting to cluster...
ing up kubeconfig...
ctl is now configured to use the cluster.
bectl run hello-minikube --image=k8s.gcr.io/echoserver:1.4 --port=8080
oyment "hello-minikube" created
bectl expose deployment hello-minikube --type=NodePort
ice "hello-minikube" exposed
have now launched an echoserver pod but we have to wait until the pod is up before curling/accessing it
a the exposed service.
check whether the pod is up and running we can use the following:
bectl get pod
READY STATUS RESTARTS AGE
o-minikube-3383150820-vctvh 1/1 ContainerCreating 0 3s
can see that the pod is still being created from the ContainerCreating status
bectl get pod
READY STATUS RESTARTS AGE
o-minikube-3383150820-vctvh 1/1 Running 0 13s
can see that the pod is now Running and we will now be able to curl it:
rl $(minikube service hello-minikube --url)
NT VALUES:
nt_address=192.168.99.1
and=GET
path=/
bectl delete service hello-minikube
ice "hello-minikube" deleted
bectl delete deployment hello-minikube
oyment "hello-minikube" deleted
nikube stop
ping local Kubernetes cluster...
ine stopped.
The minikube start
command creates a “kubectl context” called “minikube”.
This context contains the configuration to communicate with your Minikube cluster.
Minikube sets this context to default automatically, but if you need to switch back to it in the future, run:
kubectl config use-context minikube
,
or pass the context on each command like this: kubectl get pods --context=minikube
.
To access the Kubernetes Dashboard, run this command in a shell after starting Minikube to get the address:
kube dashboard
To access a service exposed via a node port, run this command in a shell after starting Minikube to get the address:
kube service [-n NAMESPACE] [--url] NAME
Minikube uses libmachine for provisioning VMs, and localkube (originally written and donated to this project by Redspread) for running the cluster.
For more information about Minikube, see the proposal.