2017-01-06 87 views
6

我正在使用gcloud上的Google容器引擎。因此,在成功完成gloud init我也跟着指示,做:找不到默認憑據

gcloud container clusters get-credentials cluster-1 --zone europe-west1-c --project whatever 

然後:

kubectl proxy 

,但我得到了以下錯誤消息:

error: google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information. 

我看到的東西,在~/.kube/config文件所以我不確定出了什麼問題。我也在機器上安裝了minikube,但我認爲這不是問題。

回答

22

使用

gcloud auth application-default login 

登錄應用程序默認creadentials。對於應用程序的默認憑據行爲在gcloudchanged因爲版本128

注意,通過gcloud auth logingcloud initgcloud config set account MY_ACCOUNT改變憑證將不會影響應用程序的默認憑據,他們從gcloud憑證單獨管理。

+1

這節省了我的謝意! –

+1

來自首爾的愛。非常感謝! – minimanimo