Failed to setup kubeconfig when starting minikube

主宰稳场 提交于 2019-12-24 06:50:00

问题


I have installed kubectl and minikube on my windows environment, but when running minikube start it creates the VM on vitualBox but I got this error when it trying to prepare kubernetes on Docker.

C:\Users\asusstrix>minikube start

* minikube v1.6.0 on Microsoft Windows 10 Home 10.0.18362 Build 18362
* Selecting 'virtualbox' driver from user configuration (alternates: [])
* Creating virtualbox VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
* Preparing Kubernetes v1.17.0 on Docker '19.03.5' ...
*
X Failed to setup kubeconfig: writing kubeconfig: Error writing file C:\Users\asusstrix/.kube/config: error acquiring lock for C:\Users\asusstrix/.kube/config: timeout acquiring mutex
*
* Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
  - https://github.com/kubernetes/minikube/issues/new/choose

回答1:


According to the official documentation:

To confirm successful installation of both a hypervisor and Minikube, you can run the following command to start up a local Kubernetes cluster:

minikube start --vm-driver=<driver_name>

For setting the --vm-driver with minikube start, enter the name of the hypervisor you installed in lowercase letters where is mentioned below. A full list of --vm-driver values is available in specifying the VM driver documentation.

So in your case it would be: minikube start --vm-driver=<virtualbox>

If you want ot make sure your previous steps were correct you can go through the whole tutorial.

Please let me know if that helped.

EDIT:

There is a Github thread showing the same issue.

Basically you still should use minikube start --vm-driver=<driver_name> but it will not work with v1.6.0 yet. Consider downgrading to v1.5.2 instead.



来源:https://stackoverflow.com/questions/59284489/failed-to-setup-kubeconfig-when-starting-minikube

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!