Installing Minikube and Kubernetes on Windows 10 image 125

Installing Minikube and Kubernetes on Windows 10

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

image

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.

image

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.

image

The directory .minikube is created:

imageAnd in VirtualBox you will find a new VM set up and running:

SNAGHTML3ce136f1

Run

minikube dashboard

and the browser will open:

image

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

image

A restart now only takes 10-15 seconds:

image

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.

image

In the dashboard, this same information is available:

image

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.

image

I can get the same information on the dashboardimage

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:

image

The nginx service can now be accessed at 192.168.99.100:32178image

And in the browser:

image