omrikiei / ktunnel

A cli that exposes your local resources to kubernetes
GNU General Public License v3.0
928 stars 71 forks source link

ERRO[0000] Failed to get k8s client: no Auth Provider found for name "gcp" #10

Closed outbounder closed 4 years ago

outbounder commented 4 years ago

Hi @omrikiei and thank you for your work!

I'm trying to use ktunnel but stumbled upon an issue which I'm posting here in case there are any clues on how to resolve :hammer: the showstopper :bug: :) (note: I'm golang newbie)

Here is what I can share so far of my findings:

Steps to reproduce

  1. download latest binary 1.1.7 for linux
  2. execute with ktunnel expose myapp 8084:8084 -n mynamespace
  3. see ERRO[0000] Failed to get k8s client: no Auth Provider found for name "gcp"

kubectl version

Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.1", GitCommit:"d224476cd0730baca2b6e357d144171ed74192d6", GitTreeState:"clean", BuildDate:"2020-01-14T21:04:32Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.8-gke.12", GitCommit:"188432a69210ca32cafded81b4dd1c063720cac0", GitTreeState:"clean", BuildDate:"2019-11-07T19:27:01Z", GoVersion:"go1.12.11b4", Compiler:"gc", Platform:"linux/amd64"}

kube config

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: ...
    server: https://endpoint
  name: long_cluster_name
contexts:
- context:
    cluster: long_cluster_name
    user: long_cluster_name
  name: long_cluster_name
current-context: long_cluster_name
kind: Config
preferences: {}
users:
- name: xyz
  user:
    auth-provider:
      config:
        access-token: XYZ
        cmd-args: config config-helper --format=json
        cmd-path: /usr/lib/google-cloud-sdk/bin/gcloud
        expiry: "UTC-DATE"
        expiry-key: '{.credential.token_expiry}'
        token-key: '{.credential.access_token}'
      name: gcp
omrikiei commented 4 years ago

Hello @outbounder, a quick search referred me to this issue stating that gcp Auth support should be explicitly imported. I've added auth support imports for existing cloud providers in v1.1.8(currently being released), however since I don't have any quick an immediate way to validate this fix, would you be able to try again and let me know if this version resolved your issue?

Thank you, Omri

outbounder commented 4 years ago

@omrikiei awesome! v1.1.8 is working now fine. I mean it is connecting and creating/deleting service deployment as expected.

I guess we can close this issue which I'm doing now but please excuse me if that was not correct :)

Thank you for your time & energy in this :gem: :heart: