问题描述
我已经在Windows环境中安装了 kubectl 和 minikube ,但是在运行 minikube start 时,它在vitualBox上创建了VM,但是我知道了尝试在Docker上准备kubernetes时出错.
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
推荐答案
根据官方文档:
minikube start --vm-driver=<driver_name>
要使用minikube start设置--vm-driver,请输入 您以小写字母安装的管理程序在哪里 如以下所说的.有关--vm-driver值的完整列表,请参见 指定 VM驱动程序 文档.
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.
因此您的情况是: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.
有一个 Github线程显示了相同的问题.
There is a Github thread showing the same issue.
基本上,您仍然应该使用minikube start --vm-driver=<driver_name>
,但它不适用于v1.6.0.考虑改为降级至v1.5.2.
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.
这篇关于启动minikube时无法设置kubeconfig的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!