- Run
gcloud auth list
to check if you have authenticated to gcloud already and what email was used. - Run
gcloud auth login
to login with the right email id. cross check with step 1 when done. - Run
gcloud auth application-default login
to set up default application credentials. - Step 3 will create a json file with credentials, you should run
export GOOGLE_APPLICATION_CREDENTIALS=$HOME/.config/gcloud/application_default_credentials.json
after cross checking if the file exists and is in the correct path which is typically$HOME/.config/gcloud/application_default_credentials.json
gcloud config set project k8s-infra-sandbox-capg
to set the correct project for operations