Minikube on Windows 10 with Hyper-V

Getting started with Kubernetes can be daunting when you don’t know where to begin. Luckily the folks at Kubernetes have a great platform you can run locally on your laptop. This will setup up a basic test bed for kubernetes called Minikube. I will quickly walk you through getting up and running with minikube.

Pre-reqs before getting started

Installation

Open a command line window with administrator privileges.

Then use the chocolatey package manager to install minikube.

choco install minikube

Next install the kubernetes command line program with the chocolatey package manager.

choco install kubernetes-cli

Once that is installed you will need to make some changes to the Windows Hyper-V manager. I will not get into the reasons why we need to make some of these changes, but the short answer is so you don’t have to do more work to run this along side other software packages like Docker-For-Windows that also use Windows Hyper-V, seamlessly.

Open the Hyper-V Manager.

Once in the Hyper-V Manager, on the right panel, select the Virtual Switch Manager.

Next we will create a virtual switch for minikube. Select New virtual network switch on the right hand side, select External for the network type, and then press the Create Virtual Switch button.

Name the switch Primary Virtual Switch and click the apply button.

Once you have the switch created we are now ready to start minikube. Run the following command to start the minikube VM with our applied changes.

minikube start --vm-driver hyperv --hyperv-virtual-switch "Primary Virtual Switch"

Once the VM is running we will have two more steps to do to address a bug in minikube for Windows. We need to turn off Dynamic Memory for the minikube VM. There is bug reported on this issue which can be found here. Once this bug has been resolved, I will update the instructions here.

In your administrator command line window stop the minikube VM with the following command.

minikube stop

Once minikube has stopped, open the Hyper-V Manager again and right click on the minikube VM and select settings.

Select the Memory option on the left panel, then de-select Enable Dynamic Memory, and then click Apply button.

Close Hyper-V manager and then return to the administrator command line window and restart minikube.

minikube start

Once minikube is restarted you should be ready to go. We will confirm the installation is ready by checking a couple of things.

In the command line window, enter the following command.

kubectl get pods -n kube-system

You should see the following result.

If you are a little more visual and want to see the kubernetes dashboard, you can open that up by typing in the following command in the command line window.

minikube dashboard

That will open up the dashboard window in your default browser.

Now you are ready to explore and start your journey to learning Kubernetes.

Side Note on IPv6 Networking and Minikube on Windows 10

If you would like to take your Kubernetes experience to the next level, try reserving a free sandbox lab environment for Kubernetes from Cisco DevNet Sandbox. Use the following guides to get started with Kubernetes in DevNet Sandbox.