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

GKE: no Auth Provider found for name "gcp" #2

Closed
adamzr opened this issue Feb 11, 2021 · 11 comments
Closed

GKE: no Auth Provider found for name "gcp" #2

adamzr opened this issue Feb 11, 2021 · 11 comments

Comments

@adamzr
Copy link

adamzr commented Feb 11, 2021

Trying to use Kubeswitch with GKE and I get this error trying to switch namespaces:

no Auth Provider found for name "gcp"

@ckt114
Copy link
Owner

ckt114 commented Feb 11, 2021

@adamzr That error seems like an issue with your kube config file. Can you test using that kube config file without using Kubeswitch and see if you can get namespaces? Do an export KUBECONFIG=/path/to/config then kubectl get ns. Looks like for that gcp context you don’t have an authentication method attached to it.

@adamzr
Copy link
Author

adamzr commented Feb 15, 2021

@trankchung I didn't have KUBECONFIG set. I set it. Then I ran kubectl get ns which worked fine. Kubeswitch still gives me the same error.

@ghost
Copy link

ghost commented Feb 15, 2021

@adamzr Do you mind try the latest version?

@adamzr
Copy link
Author

adamzr commented Feb 15, 2021

Still doesn't work:

$ kubeswitch --version
v0.2.3
$ kubeswitch ns
no Auth Provider found for name "gcp"

@ghost
Copy link

ghost commented Feb 15, 2021

Once in a Kubeswitch session, can you cat $KUBECONFIG and paste the content here? You can mask out sensitive info. I want to see the auth section of the config.

@adamzr
Copy link
Author

adamzr commented Feb 15, 2021


apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: <REDACTED LONG BASE64 LOOKING STRING>
    server: https://<REDACTED IP>
  name: gke_<REDACTED CLUSTER NAME>_us-west1-c_<REDACTED CLUSTER NAME>
- cluster:
    certificate-authority-data: <REDACTED LONG BASE64 LOOKING STRING>
    server: https://<REDACTED IP>
  name: gke_<REDACTED CLUSTER NAME>_us-west1-c_<REDACTED CLUSTER NAME>
- cluster:
    certificate-authority-data: <REDACTED LONG BASE64 LOOKING STRING>
    server: https://<REDACTED IP>
  name: gke_<REDACTED CLUSTER NAME>_us-west1-c_<REDACTED CLUSTER NAME>
contexts:
- context:
    cluster: gke_<REDACTED CLUSTER NAME>_us-west1-c_<REDACTED CLUSTER NAME>
    namespace: <REDACTED CLUSTER NAME>
    user: gke_<REDACTED CLUSTER NAME>_us-west1-c_<REDACTED CLUSTER NAME>
  name: <REDACTED CLUSTER NAME>
- context:
    cluster: gke_<REDACTED CLUSTER NAME>_us-west1-c_<REDACTED CLUSTER NAME>
    user: gke_<REDACTED CLUSTER NAME>_us-west1-c_<REDACTED CLUSTER NAME>
  name: <REDACTED CLUSTER NAME>
- context:
    cluster: gke_<REDACTED CLUSTER NAME>_us-west1-c_<REDACTED CLUSTER NAME>
    user: gke_<REDACTED CLUSTER NAME>_us-west1-c_<REDACTED CLUSTER NAME>
  name: <REDACTED CLUSTER NAME>
current-context: <REDACTED CLUSTER NAME>
kind: Config
preferences: {}
users:
- name: gke_<REDACTED CLUSTER NAME>_us-west1-c_<REDACTED CLUSTER NAME>
  user:
    auth-provider:
      config:
        access-token: <REDACTED ACCESS TOKEN>
        cmd-args: config config-helper --format=json
        cmd-path: /Users/<REDACTED>/google-cloud-sdk/bin/gcloud
        expiry: "2021-02-15T17:58:56Z"
        expiry-key: '{.credential.token_expiry}'
        token-key: '{.credential.access_token}'
      name: gcp
- name: gke_<REDACTED CLUSTER NAME>_us-west1-c_<REDACTED CLUSTER NAME>
  user:
    auth-provider:
      config:
        access-token: <REDACTED ACCESS TOKEN>
        cmd-args: config config-helper --format=json
        cmd-path: /Users/<REDACTED>/google-cloud-sdk/bin/gcloud
        expiry: "2021-02-15T20:37:24Z"
        expiry-key: '{.credential.token_expiry}'
        token-key: '{.credential.access_token}'
      name: gcp
- name: gke_<REDACTED CLUSTER NAME>_us-west1-c_<REDACTED CLUSTER NAME>
  user:
    auth-provider:
      config:
        access-token: <REDACTED ACCESS TOKEN>
        cmd-args: config config-helper --format=json
        cmd-path: /Users/<REDACTED>/google-cloud-sdk/bin/gcloud
        expiry: "2021-01-19T02:46:23Z"
        expiry-key: '{.credential.token_expiry}'
        token-key: '{.credential.access_token}'
      name: gcp

@ckt114
Copy link
Owner

ckt114 commented Feb 15, 2021

The config looks fine. Looks like this is an issue with client-go library, link below, that’s used by Kubeswitch. I’ll try to use a newer client-go version and see if it’ll fix the problem.

sunny0826/kubecm#17

@ckt114
Copy link
Owner

ckt114 commented Feb 16, 2021

@adamzr I just tried it with my GKE account and I'm able to get namespaces and all resources fine. Can you run kubectl version --client --short and see what version you're using? I'm using Client Version: v1.18.0 and it's working fine.

@ckt114
Copy link
Owner

ckt114 commented Feb 16, 2021

@adamzr Sorry I actually was able to reproduce the error. I'll work on getting it working hopefully soon.

@ckt114
Copy link
Owner

ckt114 commented Feb 16, 2021

@adamzr
Copy link
Author

adamzr commented Feb 16, 2021

That works! Thanks @trankchung !

@adamzr adamzr closed this as completed Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants