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

Error: no Auth Provider found for name "gcp" #17

Closed
cig0 opened this issue Dec 14, 2020 · 9 comments
Closed

Error: no Auth Provider found for name "gcp" #17

cig0 opened this issue Dec 14, 2020 · 9 comments
Assignees
Labels
help wanted Extra attention is needed kind/bug Something isn't working

Comments

@cig0
Copy link

cig0 commented Dec 14, 2020

Hi,

I got this error message when trying to list the namespaces of my GKE cluster; please find below a sanitised version of ~/.kube/config:

% cat ~/.kube/config
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: blah
    server: https://localhost:6443
  name: default
- cluster:
    certificate-authority-data: blah
    server: https://1.2.3.4
  name: gke_cluster
contexts:
- context:
    cluster: gke_cluster
    namespace: default
    user: gke_cluster
  name: gke_cluster
- context:
    cluster: default
    user: default
  name: minikube
current-context: gke_cluster
kind: Config
preferences: {}
users:
- name: default
  user:
    password: blah
    username: blah
- name: gke_cluster
  user:
    auth-provider:
      config:
        access-token: token_blah
        cmd-args: config config-helper --format=json
        cmd-path: /Users/cig0/Applications/google-cloud-sdk/bin/gcloud
        expiry: "blah"
        expiry-key: '{.credential.token_expiry}'
        token-key: '{.credential.access_token}'
      name: gcp

It is worth noting that I'm able to work with this context/cluster using kubectl or other CLI tools.

% kubecm version
Version: 0.13.0
GoOs: darwin
GoArch: amd64

Thanks! 🙏

@sunny0826
Copy link
Owner

Did this error occur in older versions?
This error is thrown by client-go.

@sunny0826 sunny0826 self-assigned this Dec 15, 2020
@sunny0826 sunny0826 added the help wanted Extra attention is needed label Dec 15, 2020
@sunny0826
Copy link
Owner

for your kubeconfig, your context named gke_cluster, Can you describe your operation in detail?

@cig0
Copy link
Author

cig0 commented Dec 16, 2020

Hi @sunny0826,

There's no much more to say about it, really.

The configuration I reproduce here is a sanitized version of that config file, where I only removed the tokens and trimmed the tail of gke_cluster to remove sensible information -- everything else is exactly the same.

I realize tho that I haven't provided the command I issued when I got the error nor the full error output, so here it goes:

~ ✖1 ❯ k get ns
NAME                  STATUS   AGE
default               Active   295d
gitlab-managed-apps   Active   233d
kube-node-lease       Active   295d
kube-public           Active   295d
kube-system           Active   295d

~ took 6s ❯ kubecm ns kube-public
Error: no Auth Provider found for name "gcp"
Usage:
  kubecm namespace [flags]

Aliases:
  namespace, ns

Examples:

# Switch Namespace interactively
kubecm namespace
# or
kubecm ns
# change to namespace of kube-system
kubecm ns kube-system


Flags:
  -h, --help   help for namespace

Global Flags:
      --config string   path of kubeconfig (default "/Users/cig0/.kube/config")

no Auth Provider found for name "gcp

~ ✖1 ❯ kubecm ns
Error: no Auth Provider found for name "gcp"
Usage:
  kubecm namespace [flags]

Aliases:
  namespace, ns

Examples:

# Switch Namespace interactively
kubecm namespace
# or
kubecm ns
# change to namespace of kube-system
kubecm ns kube-system


Flags:
  -h, --help   help for namespace

Global Flags:
      --config string   path of kubeconfig (default "/Users/cig0/.kube/config")

no Auth Provider found for name "gcp"

@sunny0826
Copy link
Owner

This issue appears to be an authentication issue with client-go, thank you for the tip, I will try to fix this.

@sunny0826
Copy link
Owner

sunny0826 commented Dec 31, 2020

This problem looks very similar to kubernetes/client-go#242, but I don't have GKE to test whether following the approach in ISSUE solves the problem.

@cig0
Copy link
Author

cig0 commented Dec 31, 2020

I could help you with that part, let me know if you need me to test anything.

Incidentally if you happen to have access to GCP, you should be able to open a free-tier account: https://cloud.google.com/free

@sunny0826
Copy link
Owner

Thanks for the tip, Happy new year!

@sunny0826 sunny0826 added the kind/bug Something isn't working label Jan 1, 2021
@sunny0826
Copy link
Owner

I've just tried to fix this on the master branch, can you pull the code from the master branch, compile and test it?

@sunny0826
Copy link
Owner

You can try the v0.13.1 version and look forward to your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants