Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find default credentials

I'm playing with Google container engine on gcloud. So after successfully finished gloud init I followed instructions and did:

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

And then:

kubectl proxy 

But I got the following error message:

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

I do see stuff in ~/.kube/config file so I'm not sure what went wrong. I have minikube also installed on the machine but I don't think that's a problem.

like image 236
lang2 Avatar asked Jan 06 '17 14:01

lang2


People also ask

Where are application default credentials stored?

Your credentials are stored at ~/. config/gcloud . Credentials are stored in two files: access_tokens.

How do I set up Gcloud project?

Just use the gcloud projects list to get the project you have . Get the PROJECT_ID of the poject to use After that use gcloud set project --project=PROJECT_ID to set the project.


1 Answers

Use

gcloud auth application-default login 

to login for application default creadentials (docs). The behavior for application default credentials has changed in gcloud since version 128.

Note that changing credentials via gcloud auth login or gcloud init or gcloud config set account MY_ACCOUNT will NOT affect application default credentials, they managed separately from gcloud credentials.

like image 151
cherba Avatar answered Sep 17 '22 12:09

cherba