Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to add gcp-auth addon fails despite having run gcloud auth login #9215

Closed
matthewmichihara opened this issue Sep 10, 2020 · 1 comment · Fixed by #9318
Closed

Trying to add gcp-auth addon fails despite having run gcloud auth login #9215

matthewmichihara opened this issue Sep 10, 2020 · 1 comment · Fixed by #9318
Labels
area/provider/gcp Issues or PRs related to gcp provider kind/documentation Categorizes issue or PR as related to documentation. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. ux/embedded Embedded UX blockers

Comments

@matthewmichihara
Copy link

matthewmichihara commented Sep 10, 2020

Trying to add the gcp-auth addon fails despite having run gcloud auth login. This is confusing because the CLI error message 💣 Could not find any GCP credentials. Either run 'gcloud auth login' or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of your credentials file. and the docs at https://minikube.sigs.k8s.io/docs/handbook/addons/gcp-auth/ make it sound like running gcloud auth login should fix the error.

It seems like what I needed to do was run gcloud auth application-default login. When I run gcloud auth application-default login and then minikube addons enable gcp-auth, it seems to work correctly.

Should this have worked with just gcloud auth login?

Steps to reproduce the issue:

$ gcloud auth list
   Credentialed Accounts
ACTIVE  ACCOUNT
*       [email protected]

To set the active account, run:
    $ gcloud config set account `ACCOUNT`

$ minikube start
😄  minikube v1.12.3 on Darwin 10.15.6
✨  Automatically selected the docker driver
❗  Requested memory allocation (1991MB) is less than the recommended minimum 2000MB. Kubernetes may crash unexpectedly.
❗  Your system has 16384MB memory but Docker has only 1991MB. For a better performance increase to at least 3GB.

	Docker for Desktop  > Settings > Resources > Memory


👍  Starting control plane node minikube in cluster minikube
🔥  Creating docker container (CPUs=2, Memory=1991MB) ...
🐳  Preparing Kubernetes v1.18.3 on Docker 19.03.8 ...
🔎  Verifying Kubernetes components...
🌟  Enabled addons: default-storageclass, storage-provisioner
🏄  Done! kubectl is now configured to use "minikube"
$ minikube addons list
|-----------------------------|----------|--------------|
|         ADDON NAME          | PROFILE  |    STATUS    |
|-----------------------------|----------|--------------|
| ambassador                  | minikube | disabled     |
| dashboard                   | minikube | disabled     |
| default-storageclass        | minikube | enabled ✅   |
| efk                         | minikube | disabled     |
| freshpod                    | minikube | disabled     |
| gcp-auth                    | minikube | disabled     |
| gvisor                      | minikube | disabled     |
| helm-tiller                 | minikube | disabled     |
| ingress                     | minikube | disabled     |
| ingress-dns                 | minikube | disabled     |
| istio                       | minikube | disabled     |
| istio-provisioner           | minikube | disabled     |
| kubevirt                    | minikube | disabled     |
| logviewer                   | minikube | disabled     |
| metallb                     | minikube | disabled     |
| metrics-server              | minikube | disabled     |
| nvidia-driver-installer     | minikube | disabled     |
| nvidia-gpu-device-plugin    | minikube | disabled     |
| olm                         | minikube | disabled     |
| pod-security-policy         | minikube | disabled     |
| registry                    | minikube | disabled     |
| registry-aliases            | minikube | disabled     |
| registry-creds              | minikube | disabled     |
| storage-provisioner         | minikube | enabled ✅   |
| storage-provisioner-gluster | minikube | disabled     |
|-----------------------------|----------|--------------|
💡  To see addons list for other profiles use: `minikube addons -p name list`
$ minikube addons enable gcp-auth --alsologtostderr
W0910 10:20:46.913318   85439 root.go:246] Error reading config file at /Users/michihara/.minikube/config/config.json: open /Users/michihara/.minikube/config/config.json: no such file or directory
I0910 10:20:46.915691   85439 addons.go:53] Setting gcp-auth=true in profile "minikube"
I0910 10:20:46.915748   85439 mustload.go:64] Loading cluster: minikube
I0910 10:20:46.916876   85439 cli_runner.go:109] Run: docker container inspect minikube --format={{.State.Status}}
I0910 10:20:46.972742   85439 host.go:65] Checking if "minikube" exists ...
I0910 10:20:46.973188   85439 cli_runner.go:109] Run: docker container inspect -f "'{{(index (index .NetworkSettings.Ports "8443/tcp") 0).HostPort}}'" minikube
W0910 10:20:47.018265   85439 out.go:151] 💣  Could not find any GCP credentials. Either run `gcloud auth login` or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of your credentials file.
💣  Could not find any GCP credentials. Either run `gcloud auth login` or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of your credentials file.
@medyagh medyagh added the ux/embedded Embedded UX blockers label Sep 10, 2020
@sharifelgamal
Copy link
Collaborator

This is a documentation issue, you need to run gcloud auth application-default login

@sharifelgamal sharifelgamal added area/provider/gcp Issues or PRs related to gcp provider kind/documentation Categorizes issue or PR as related to documentation. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/provider/gcp Issues or PRs related to gcp provider kind/documentation Categorizes issue or PR as related to documentation. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. ux/embedded Embedded UX blockers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants