Run k8s minikube on Windows 10 with Hyper-V

fred @ Veröffentlicht am (Update: )

Setting up minikube on a Windows 10 computer is (in theory) the most easy thing to do since Hyper-V already does the virtualization and there is no additional software to be installed. Yay.

Where it really gets hairy are a few things that might not run out of the box right away and I’ll try to give you the shortest guide possible here to get minikube up and running on your machine.

(1) Go and get minikube for Windows

Make sure you have Docker and kubctl installed. Download the minikube executable for Windows. You can find the latest one in the release section of the minikube repository I recommend not to use the installer since this way it will keep this very lightweight and portable. Put it into some folder (preferably next to kubectl) and add it to your path variable.

(2) The virtual network switch

If you haven’t done so when working with Docker, add a virtual network switch for external connections. This is done fairly quickly and well described in this article. Make sure you pick a name you can remember.

And reboot. Just to be on the safe side.

(3)¬†Use the right shell in the right mode aka “Why Powershell is your worst option”

This is one of the most common pitfalls setting up minikube: The shell. First off – you’re going to instrument Hyper-V at one point. So whatever shell you’re running on, make sure you’re in administrator mode.

Secondly, neither Powershell or cmd come with a native SSH integration. So if you fire up minikube the process will appear to be stuck and throw the most cryptic error messages into your face. So any of these look familiar to you, read on:

OS type not recognized

Waiting for SSH to be available…

Creating machine…

I higly recommend using git bash (on mingw64) and I’m fairly sure most of you guys have this on your computers already. Also make sure you log everything you can out of your first minikube run. Otherwise it will be insanely hard to troubleshoot. This is what you should call now:

minikube start –vm-driver hyperv –hyperv-virtual-switch=k8svswitch –v=3 –show-libmachine-logs –alsologtostderr

–vm-driver tells minikube to use hyperv instead of virtualbox (which is the default).

–hyperv-virtual-switch lets the switch you just created come into play.

The remainder of the call is the sheer fireworks of logging that pretty much makes sure we get everything that happens while this command runs on screen right away.

That’s really it. Your PC should now run minikube.

Bonus: config.json went missing

If minikube starts complaining that there’s no such file or directory, the fastest way is to fire up the Hyper-V manager, delete the minikube instance and head over to your user folder and get rid of the .minikube directory as well. You will have to create minikube from scratch again, but nevertheless it will work again. Another way is to create backups of that file frequently to save yourself the hassle.

Veröffentlicht am (Update: )

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.



Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr dar√ľber, wie deine Kommentardaten verarbeitet werden .