google-kubernetes-engine - ERROR: gcloud crashed (WindowsError): [Error 3] The system cannot find the path specified: u'W:\\'
问题描述
我正在使用 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的系统变量部分。
这解决了问题,之后命令运行良好。
推荐阅读
- sails.js - 如何在sails.js >v1.0 中使用动态页面标题?
- c++ - C++ 强制从不同的继承层次实现纯虚方法
- json - JArray 上的 LINQ 总是返回 null
- spring-batch - Spring批处理如何让Writer知道它收到了最后一个通过流运行的实体
- c# - 开关盒中的额外条件(Fallthrough?)
- java - android api 23+,在根外部存储中写入文件
- excel - Excel 附加实例
- jquery - jQuery DataTables 编辑 jquery dataTable 中的行并保存到数据库
- android - Android NDK 调用 Java 函数
- html - 代码更改后代码输出不变