Kubernetes Minikube Windows



Some notes when troubleshooting Minikube issue (Docker issue with HyperV & VirtualBox).


+ Should place kubectl path before Docker path in %PATH% , because new Docker versions also bundle a kubectl executable.

+ If already has gcloud shell, install kubectl from there

gcloud components install kubectl

(GcloudSDK already in %PATH%, no need using other ways, easier to check version)

+ On Win 10: prefer HyperV over VirtualBox: they might conflict about memory issue, minikube can use either with appropriate driver (e.g. --vm-driver hyperv ) , but Docker will be more picky. This might lead to some silly circular issues, especially when mixed with some other issues.

+ HyperV switch should be “External” – can based on Wireless adapter or Ethernet adapter depending on your current connection – but make sure to disable IPv6 on this switch adapter, for cluster local minikube.
(Using “Internal” switch is possible, but would require some more configuration).

+ Executable of minikube (minikube.exe) should be placed on drive of “%UserProfile%” , namely “C:” drive. Not easily fixed to “D:” or “E:” without some quirky hacks. This sound silly (Windoze tradition!), but there is a number of GitHub issues about that, like: https://github.com/minishift/minishift/issues/236

+ Can use HyperV management tool (virtmgmt.msc) to stop the minikube cluster with HyperV driver , even when the OS tool shutdown ( ​`minikube stop` ) doesn’t work.
Yet for other purposes don’t use HyperV console, use minikube or docker-machine https://forums.docker.com/t/using-docker-for-windows-docker-machine-create/8032

+ On minikube HyperV, it’s recommended to disable dynamic memory management, and set at least 4096MB (or runtime param `–memory 4096` ), to avoid issues such as: https://github.com/kubernetes/minikube/issues/2326

+ When minikube issue occurs and you want to re-install cleanly, make sure to remove %UserProfile%/.kube and .minikube folders, which contains some cache and config might reproduce your issue. For example, .kube/config might contain old IP address, and SSH client might fail until fix IP (or make it static in LAN NAT)

+ If minikube version latest (v0.28.2) does not work, you might remove it and use previous version (v0.27.0 or v0.25.2) . Besides, it’s recommended to used elevated (Administrator) console, even PowerShell, except for GitBash.





Anyway, too much hassle for a should-be-simple installation. This might be an obstacle/impediment for people who don’t have high patience.

If you don’t want to endure it, I would recommend using Linux Ubuntu (16.04 or any other LTS like 18.04) or MacOS.

Win 10 is really slow for development, especially when Docker involves (platform dependent internally).






About DucQuoc.wordpress.com

A coder, husband and brother...
This entry was posted in Feeling, Linux, Skill. Bookmark the permalink.

1 Response to Kubernetes Minikube Windows

  1. Some command lines:

    Enable HyperV using PowerShell (Admin privileges – elevated)
    powershell -Command “Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All”

    Get IP addresses of HyperV running machines:
    powershell -Command “Get-VM | Select-Object -ExpandProperty NetworkAdapters | Select-Object VMName,IPAddresses”

    Update IP addresses:
    minikube update-context && eval $(minikube docker-env) && eval $(minikube docker-env -u)

    docker-machine env
    FOR /f “tokens=*” %i IN (‘docker-machine env’) DO @%i
    docker-machine renegenate-certs default

    I still recommend Ubuntu, though (18.04 or 16.04 is good). It’s much easier to use minikube , or “microk8s” , or even kubeadm. (Windows Subsystem for Linux is actually an adapter layer on top of a Ubuntu image).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s