Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
docs(gke/boot): Update command to auth to kubernetes host
Browse files Browse the repository at this point in the history
When I ran `$ kubectl cluster-info`, I got this error:
`error: google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.`

Looks like the auth mechanism was updated a few months ago: kubernetes/kubernetes#30617

"""
Previously, gcloud would have configured kubectl to use the cluster's static client certificate to authenticate. Now, gcloud is configuring kubectl to use the service account's credentials.

Kubectl is just using the Application Default Credentials library, and it looks like this is part of the ADC flow for using a JSON-key service account.
"""

At the bottom of that thread, this command was suggested, which worked for me:
`$ gcloud auth application-default login`.
  • Loading branch information
chexxor committed Dec 6, 2016
1 parent 908f516 commit 48b875e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/quickstart/provider/gke/boot.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,16 @@ If you haven't configured your default zone, make sure it matches the ZONE for y
$ gcloud config set compute/zone us-central1-b
```

Now you may fetch Kubernetes credentials:
Now you may fetch credentials to connect to Kubernetes:
```
$ gcloud container clusters get-credentials cluster-1
Fetching cluster endpoint and auth data.
kubeconfig entry generated for cluster-1.
$ gcloud auth application-default login
Your browser has been opened to visit:
https://accounts.google.com/o/oauth2/auth?redirect_uri=....
Credentials saved to file: [~/.config/gcloud/application_default_credentials.json]
These credentials will be used by any library that requests
Application Default Credentials.
```

If you don't have `kubectl` CLI setup just yet, run this to get it available
Expand Down

0 comments on commit 48b875e

Please sign in to comment.