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.
Your credentials are stored at ~/. config/gcloud . Credentials are stored in two files: access_tokens.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With