Could not find default credentials

KubernetesGcloud

Kubernetes Problem Overview


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.

Kubernetes Solutions


Solution 1 - Kubernetes

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionlang2View Question on Stackoverflow
Solution 1 - KubernetescherbaView Answer on Stackoverflow