Closed adamzr closed 3 years ago
@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.
@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.
@adamzr Do you mind try the latest version?
Still doesn't work:
$ kubeswitch --version
v0.2.3
$ kubeswitch ns
no Auth Provider found for name "gcp"
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.
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
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.
@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.
@adamzr Sorry I actually was able to reproduce the error. I'll work on getting it working hopefully soon.
@adamzr Please try newest version. https://github.com/trankchung/kubeswitch/releases/tag/v0.2.4
That works! Thanks @trankchung !
Trying to use Kubeswitch with GKE and I get this error trying to switch namespaces:
no Auth Provider found for name "gcp"