我使用的是 Google Cloud SDK 外壳。输入以下命令时:
gcloud container clusters get-credentials test-cluster
我收到以下错误:
ERROR: gcloud crashed (WindowsError): [Error 3] The system cannot find the path specified: u'W:\\'
我不确定为什么会这样。此命令应该只配置 kubectl
以使用我已经创建的名为“test-cluster”的集群,但它正在尝试查找驱动器 W:,我知道它不存在。
最佳答案
我的同事遇到了这个问题。他正在使用安装了 docker 桌面的 Windows 10。
DazWilkin 在评论中提到了关于 KUBECONFIG 环境变量的问题。
这让我们得以解决问题,谢谢 DazWilkin!
这是我们修复它的方式:
所以他安装了 docker desktop 但没有启用 Kubernetes。所以他丢失了 {HOME}/.kube/config 文件夹和文件。他在 docker desktop 中启用了 kubernetes,并在系统变量部分添加了环境变量。
所以变量:KUBECONFIG 和值:pathtohome.kube\config (C:\users\username.kube\config)
在 windows 的系统变量部分。
这解决了问题,此后命令运行正常。
关于google-kubernetes-engine - 错误 : gcloud crashed (WindowsError): [Error 3] The system cannot find the path specified: u'W:\\',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59570592/