Minikube: Try Kubernetes on Windows without headaches

Kubernetes Logo
Kubernetes Logo

Kubernetes is the leading container orchestration software. After winning the so-called container war, Kubernetes affirmed itself as the leader in its field. However Kubernetes is complex, really complex if you’re just getting started. If you want to try Kubernetes but don’t want to set up a real, full-blown cluster this solution is for you. Minikube is a great way to test Kubernetes capabilities without committing hardware to it. By using Kubernetes you will set up a virtual machine on your hardware, this vm will be your very own one-machine cluster and when you’re done you can simply throw it away.

Kubernetes on Windows, meet Minikube

Minikube is a quick and easy way to set up a Kubernetes cluster (What is Kubernetes?) in a single vm without committing hardware to it. With this setup you don’t need to worry about breaking things since you can tear up and start anew in a matter of minutes.

By installing MiniKube you will essentially download and install a Linux virtual machine configured with Kuberentes. it is hence highly discouraged to use it in production.

Requirements

  • You need a machine capable of performing Virtualization.
  • If you want to use HyperV, you need a compatible Windows edition (e.g. Windows 10 Pro. Windows 10 Home can’t.)
  • At least 4GB of RAM (suggested).

MiniKube on Windows: HyperV or VirtualBox

The first thing you will need in order to begin is a hypervisor to run the Minikube virtual machine, you can either use:

  • HyperV: the native Windows hypervisor.
  • VirtualBox: an open source hypervisor by Oracle available on many operating systems.

Although the suggested hypervisor is VirtualBox you should be able to install it using HyperV without major issues, the default one is the former. In this tutorial you can use either one, I will assume you already have your hypervisor installed and running.

Getting Minkube and setting environment

Let’s start!

  • First: download the Minikube executable, pick the one for Windows. The link takes you to the latest version, at the moment of writing this article the latest version was v1.10.0.
  • Second: download the Kubectl executable for Windows. It is best to get the same version as Minikube. Unfortunately there’s no public release page, you will have to modify the link manually to change the version.
  • Third: move both files in a subdirectory of C:\ it’s best to avoid other drives/network drives. I suggest you to extract it in the C:\minikube subdirectory.
  • Fourth: add the path you chose to the PATH environment variable. You can do so graphically or using the following PowerShell command:
Replace C:\minikube with the path you chose during the second step. Now that you have set the environment up, it’s time to install!

Installing Minikube

With the environment set, you’re just a few steps away from installing and using Minikube. Pick the steps associated with your hypervisor and open an elevated PowerShell prompt:

HyperVVirtualBox

Before you actually do anything you must be part of the HyperV Administrators group. If you’re using a different language you will need to replace Hyper-V Administrators with the corresponding group in your system’s language.

Although you can add yourself to the group in your own language, as the time of writing this article, it doesn’t work and you will need an elevated PowerShell prompt.

You can add yourself by typing:

Next you will need to create an External switch, your VMs will need it to connect to the internet. Follow these steps by Microsoft to create the External switch, be sure to pick External as type.

Now you need to set the environment variable to tell Minikube which switch to use. Replace the value (in this case External) with the name you chose for the switch earlier.

Set up HyperV as default driver, this will prevent Minikube from using VirtualBox and breaking your computer:

Now you can start the installation:

Set up VirtualBox as default driver, this will prevent Minikube from using VirtualBox and breaking your computer:

Now you can start the installation:

Enjoy Kubernetes with MiniKube

Congratulations! You just installed Minikube! You can now type minikube dashboard to open the Web UI in your default browser!

Kubernetes Dashboard

Accessing Kubernetes

Now that you have Kubernetes up and running, you can use the Web UI as well as the kubectl command line utility to interact with your Kubernetes installation. Remember you still have the minikube executable that you can use to control the Minikube vm.

Starting Kubernetes

Stopping Kubernetes

Deleting (erasing completely) Kubernetes

Image courtesy of mark | marksei

The following two tabs change content below.
The IT guy with a little boredom look in his eyes, fond of computers since forever he now works as a freelancer in the IT and shares his experiences through this blog.

You may also like...