问题
Hi yet once again my beloved community.
My v0.33.1 minikube hangs on the "Starting VM..." step. I am using Windows 10 and a HyperV vm underneath. I am running my cluster with the following command:
minikube start --kubernetes-version="v1.10.11" --memory 4096 --vm-driver hyperv --hyperv-virtual-switch "HyperV Switch"
and my Docker is:
Version 2.0.0.3 (31259)
Channel: stable
Build: 8858db3
The VM underneath goes up but its CPU eventually falls down to 0% usage and it just stalls. Kubectl hangs as well.
I have already tried:
- Clearing out the Minikube cache under users/.../.minikube
- Minikube Delete
- Reinstall Minikube and Kubernetes CLI
- Reinstall Docker
- Meddling with the VM on the HyperV Host
回答1:
Following the suggestion from Diego Mendes in the comment I investigated the issue causing the minikube machine to get IPv6 addressation which would cause it to hang on startup.
I disabled IPv6 on the Virtual Network Switch (this can be done from the Network and Sharing Center -> Adapter Settings -> Right Click relevant Switch and just find the relevant checkbox) but the VM would regardless fetch an IPv6 address.
Since v18.02 or later, Docker for Windows comes with an embedded Kubernetes cluster, this meddles with the minikube config causing it to choke having 2 clusters. The solution that fit my requirements was switching from using minikube to just using the internal native docker k8s cluster (The only major drawback is that you cannot specify k8s version but overall it makes the scripts simpler).
You will have to run:
- minikube delete
Then change the kubernetes cluster context to point to the docker instance:
- kubectl config use-context docker-for-desktop
And now you should be able to do all the operations you would normally do with kubectl.
回答2:
Piotr, concerning minikube on Windows you can also use docker toolbox and VirtualBox. I have explained this here. Also you could try using chocolatey to install minikube which in my particular case was working well with Docker for Windows and minikube with Hyper-V in parallel.
As for this case it is really interesting because I had seen at least few cases where someone had troubles with the minikube for Windows and there was no obvious reason for that.
来源:https://stackoverflow.com/questions/54774023/minikube-hangs-on-the-starting-vm-step