首页 > 解决方案 > 在 windows 上安装 minikube

问题描述

我正在尝试minikube在Windows上安装,但安装过程中出现如下错误:

E0328 17:03:10.003001    5340 start.go:209] Error caching images:  Caching images for kubeadm: caching images: caching image C:\Users\User\.minikube\cache\images\k8s.gcr.io\kube-proxy_v1.14.0: getting destination path: parsing docker archive dst ref: replace a Win drive letter to a volume name: exec: "wmic": executable file not found in %PATH%
-   Preparing Kubernetes environment ...
X   Unable to load cached images: loading cached images: loading image C:\Users\User\.minikube\cache\images\k8s.gcr.io\k8s-dns-kube-dns-amd64_1.14.13: FindFirstFile C:\Users\User\.minikube\cache\images\k8s.gcr.io\k8s-dns-kube-dns-amd64_1.14.13: The system cannot find the path specified.
-   Pulling images required by Kubernetes v1.14.0 ...

请你帮助我好吗?

标签: kubernetesminikube

解决方案


您没有提供您尝试安装 minikube 的方式以及您的 PC 上安装的其他内容。因此,很难提供 100% 准确的答案。我将尝试提供一种用于在 Windows 上安装 minikube 的方法,如果这没有帮助,请提供有关您执行了哪些步骤导致此错误的更多信息。我不想猜测,但您似乎没有将 minikube 二进制文件添加到您的 PATH 中:

executable file not found in %PATH% - Preparing Kubernetes environment ...

首先让我们删除当前安装的所有痕迹。运行minikube delete转到 C:\Users\current-user\ 并删除.kube.minikube文件夹。

打开 Powershell 并安装 Chocolatey,如下所述

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

安装后运行choco install minikube kubernetes-cli

现在,根据您要使用的虚拟机管理程序,您可以按照本教程(Hyper-V) 中的步骤进行操作。您也可以使用 VirtualBox,但是您将无法使用 Docker for Windows(假设您愿意) - 您可以在我的答案之一中阅读更多信息。另一种可能性是在 Docker for Windows 中使用 Kubernetes,如此所述- 但在这种情况下您不会使用 minikube。


推荐阅读