K8s getting error after change gcloud sdk location on Macos

1/6/2020

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.

-- tuanngocptn
gcloud
google-kubernetes-engine
kubernetes

1 Answer

1/6/2020

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.

-- Amit Kumar Gupta
Source: StackOverflow