Quick notes on the installaton of Minikube for trying out Kubernetes on my Windows 10 laptop (using VirtualBox –not Hyper-V)
Following instructions in https://www.ibm.com/support/knowledgecenter/en/SS5PWC/minikube.html
Download Windows installer for MiniKube:
https://github.com/kubernetes/minikube/releases
Run installer
After running the installer, open a command line window
Download kubectl.exe
curl -o kubectl.exe https://storage.googleapis.com/kubernetes-release/release/v1.8.0/bin/windows/amd64/kubectl.exe
Copy downloaded file to a proper location – of your choosing – and add that location to the PATH environment variable.
Open a new command line window, set MINIKUBE_HOME
set MINIKUBE_HOME=C:\Users\lucas_j\.minikube
and run
minikube start
to start Minikube.
The VM image is downloaded in which the Kubernetes cluster will be created and ran. This image is 139 MB, so this startup takes a while – but of course only the first time.
The directory .minikube is created:
And in VirtualBox you will find a new VM set up and running:
Run
minikube dashboard
and the browser will open:
with an overview from within the VM of the Kubernetes Cluster.
With
minikube stop
you can halt the cluster – later to be started again using minikube start
A restart now only takes 10-15 seconds:
Using the instructions here – https://github.com/kubernetes/kubernetes/blob/master/examples/simple-nginx.md – I can quickly run a Docker Image on my minikube cluster:
kubectl run my-nginx –image=nginx –port=80
This will create two nginx pods listening on port 80. It will also create a deployment named my-nginx to ensure that there are always two pods running.
In the dashboard, this same information is available:
kubectl expose deployment my-nginx –type=”NodePort”
is used to expose the deployment – make it accessible from outside the cluster.
Using
kubectl get services
I get a list of services and the local IP address and port on which they are exposed.
I can get the same information on the dashboard
The IP address where the VirtualBox VM can be accessed is 192.168.99.100 – as can be seen for example from the URL where the dashboard application is accessed:
The nginx service can now be accessed at 192.168.99.100:32178
And in the browser: