Closed rohitagarwal003 closed 6 years ago
I am running into the same issue regarding my GKE clusters but it also refuses to load my minikube configuration:
[none] [none] [none] > contexts
gke_something_us-central1-b_autoscaling
gke_something_us-central1-b_production-b
gke_something_us-central1-c_staging
minikube
[none] [none] [none] > context gke_something_us-central1-b_production-b
[Warning] Couldn't find/load context gke_something_us-central1-b_production-b, now no current context. Error: Failed to get config: Invalid context gke_something_us-central1-b_production-b. Each user must have either a token, a username AND password, or a client-certificate AND a client-key.
[none] [none] [none] > context minikube
Private key data was invalid: ()
[Warning] Couldn't find/load context minikube, now no current context. Error: Failed to get config: Can't read/convert cert or private key for minikube
Thanks for the reports. I tested a bit with minikube, but haven't done so extensively. I'll see if I can reproduce this and get it fixed.
GKE kubeconfig uses the "gcp" auth plugin, which uses either the gcloud tool or application default credentials to get the auth token. Seems click doesn't support it.
same issue, kind of a dealbreaker :( ... but click looks really awesome
Another GKE user here, would love to use click.
As per https://github.com/databricks/click/issues/37#issuecomment-376968744, it's not only the gcp
auth plugin that is not working, but the oidc
one as well
Thanks for all the input everyone. Auth is definitely one of the trickiest bits of all this to get right. I'll be looking into if/how we can support these methods in the near future.
I have a branch with initial support here: https://github.com/nicklan/click/tree/gke-support-v1
If people want to test it out and leave feedback here that would be helpful, thanks
@nicklan I can now connect to our GKE clusters using the gke-support-v1
branch. I tried several of the commands and did not run into any issues. Thanks, BTW.
With current master I can set the context, but nothing seems to work past that point:
Server Error: pods is forbidden: User "system:anonymous" cannot list pods in the namespace "dev": No policy matched. Unknown user "system:anonymous"
@nicklan Works great! No issues so far!
I had this error with the current master branch
Hyper error: failed to lookup address information: nodename nor servname provided, or not known
Switching with gke-support-v1
solved my problem.
Thanks a lot @nicklan!
@gytisgreitai hrmm, that's odd. I believe I saw that when the token wasn't getting sent properly and so click doesn't authenticate. Would you mind opening a new issue where you include the relevant bits of your kube config file?
I tried using it with a GKE cluster but couldn't set the context. Am I doing something wrong?