K8s 在 macOS 更改 gcloud sdk 位置后出现错误。

huangapple go评论57阅读模式
英文:

K8s getting error after change gcloud sdk location on Macos

问题

我刚刚成功连接到我的Kubernetes集群。

但之后,我需要将gcloud的位置从/Download更改为/usr文件夹。

接下来,我运行install.sh文件以更新.bash_profile中的新位置。

然后,我检查gcloud命令。它正常工作。

但当我运行kubectl get pod时,出现错误。

"无法连接到服务器:执行访问令牌命令"/Users/panda/Downloads/google-cloud-sdk/bin/gcloud config config-helper --format=json"时出错:err=fork/exec /Users/panda/Downloads/google-cloud-sdk/bin/gcloud: 没有这个文件或目录 output= stderr="

嗯,如何更新gcloud SDK的位置以解决这个问题。

谢谢你的帮助。

英文:

I'm just fished connect to my kubernete.

But affter that I need to change the gcloud location from /Download to /usr folder.

Next, I run install.sh file for update the new location in .bash_profile.

Then I check gcloud command. It working well

But when I run kubectl get pod. The error showing.

Unable to connect to the server: error executing access token command "/Users/panda/Downloads/google-cloud-sdk/bin/gcloud config config-helper --format=json": err=fork/exec /Users/panda/Downloads/google-cloud-sdk/bin/gcloud: no such file or directory output= stderr=

Hmm, how to update the location of gcloud sdk for solve this problem.

Thanks for your help.

答案1

得分: 4

在您的Kubeconfig文件中(可能在~/.kube/config中),您将看到它具有旧路径到您的gcloud CLI。请使用新路径更新该文件。

英文:

In your Kubeconfig file (probably in ~/.kube/config) you’ll see it has the old path to your gcloud CLI. Update that file with the new path.

huangapple
  • 本文由 发表于 2020年1月7日 00:38:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/59615785.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定