Skip to content

Doesn't work on GKE #2

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

Closed
kklin opened this issue Dec 25, 2018 · 11 comments
Closed

Doesn't work on GKE #2

kklin opened this issue Dec 25, 2018 · 11 comments

Comments

@kklin
Copy link
Contributor

kklin commented Dec 25, 2018

I got this error when trying this against a GKE cluster:

2018/12/24 17:46:28 error loading file  open /Users/kevin/.kube/debug-config: no such file or directory
No Auth Provider found for name "gcp"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1b459b8]

goroutine 1 [running]:
github.com/aylei/kubectl-debug/pkg/plugin.(*DebugOptions).Run(0xc4202621c0, 0x0, 0x0)
        /Users/alei/go/src/github.com/aylei/kubectl-debug/pkg/plugin/cmd.go:193 +0x48
github.com/aylei/kubectl-debug/pkg/plugin.NewDebugCmd.func1(0xc420295180, 0xc420322bd0, 0x1, 0x3)
        /Users/alei/go/src/github.com/aylei/kubectl-debug/pkg/plugin/cmd.go:94 +0x134
github.com/aylei/kubectl-debug/vendor/github.com/spf13/cobra.(*Command).execute(0xc420295180, 0xc4200d60d0, 0x3, 0x3, 0xc420295180, 0xc4200d60d0)
        /Users/alei/go/src/github.com/aylei/kubectl-debug/vendor/github.com/spf13/cobra/command.go:766 +0x2c1
github.com/aylei/kubectl-debug/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc420295180, 0x1e5edf0, 0x1bed6c0, 0x1e5af50)
        /Users/alei/go/src/github.com/aylei/kubectl-debug/vendor/github.com/spf13/cobra/command.go:852 +0x30a
github.com/aylei/kubectl-debug/vendor/github.com/spf13/cobra.(*Command).Execute(0xc420295180, 0xc4200dc000, 0x1e64980)
        /Users/alei/go/src/github.com/aylei/kubectl-debug/vendor/github.com/spf13/cobra/command.go:800 +0x2b
main.main()
        /Users/alei/go/src/github.com/aylei/kubectl-debug/cmd/plugin/main.go:16 +0x112

I've seen this in my own projects before. It'll probably be fixed by importing the auth plugins: kubernetes/client-go#242 (comment).

@aylei
Copy link
Owner

aylei commented Dec 25, 2018

@kklin Thanks! I'll take a look later today and test it upon GKE.

@aylei
Copy link
Owner

aylei commented Dec 25, 2018

@kklin Or would you like to send a PR if importing the auth plugins works for you?

@kklin
Copy link
Contributor Author

kklin commented Dec 25, 2018

Sure. I took a quick look: adding the auth plugins fixed the error with parsing the kubeconfig, but it still doesn't work with GKE because the hostIP of the DaemonSet pods are private:

kevin@Kevins-MacBook-Pro-2 kubectl-debug % kubectl debug tiller-deploy-6d95c79967-bqxxc -n kube-system
2018/12/24 21:18:20 error loading file  open /Users/kevin/.kube/debug-config: no such file or directory
error execute remote, error sending request: Post http://10.128.0.4:10027/api/v1/debug?command=%5B%22bash%22%5D&container=docker%3A%2F%2Fac7e6b66f589204696db611077d6bc4d1d71d0f89835ef555d4b3778b2721728&image=nicolaka%2Fnetshoot%3Alatest: dial tcp 10.128.0.4:10027: connect: operation timed out
error sending request: Post http://10.128.0.4:10027/api/v1/debug?command=%5B%22bash%22%5D&container=docker%3A%2F%2Fac7e6b66f589204696db611077d6bc4d1d71d0f89835ef555d4b3778b2721728&image=nicolaka%2Fnetshoot%3Alatest: dial tcp 10.128.0.4:10027: connect: operation timed out
kevin@Kevins-MacBook-Pro-2 kubectl-debug % kubectl get pod debug-agent-c2shn -o yaml
  ...

  hostIP: 10.128.0.4
  phase: Running
  podIP: 10.128.0.4
  qosClass: Burstable
  startTime: 2018-12-25T01:46:05Z

I would PR the auth plugin fix, but I couldn't figure out the right way to update Gopkg.toml.

@aylei
Copy link
Owner

aylei commented Dec 25, 2018

Adding the import statement and run dep ensure locally will do the work.

the hostIP of the DaemonSet pods are private

I need to do some investigation about this problem (solution to access the hostIP&hostPort in GKE from client).
But generally, the hostIP & hostPort is not always available (or say, typically not available if cluster is set up with security consideration), so I plan to add an extend apiserver acting as the gateway. I will track this in another issue.
Thank you so much for your information, again😁

@aylei
Copy link
Owner

aylei commented Dec 27, 2018

@kklin Hi, anything blocking? How can I help?

kklin added a commit to kklin/kubectl-debug that referenced this issue Dec 27, 2018
Kubectl clients connect to GKE using the GCP auth provider. Before, the
kubectl-debug plugin would panic because it couldn't find the GCP auth
provider -- this commit adds support for all auth providers defined by
client-go.

Fixes aylei#2.
@aylei aylei closed this as completed in #5 Dec 28, 2018
aylei pushed a commit that referenced this issue Dec 28, 2018
Kubectl clients connect to GKE using the GCP auth provider. Before, the
kubectl-debug plugin would panic because it couldn't find the GCP auth
provider -- this commit adds support for all auth providers defined by
client-go.

Fixes #2.
@gadiener
Copy link
Contributor

Hello @aylei,
thanks for this nice project, I keep seeing this issue:

No Auth Provider found for name "gcp"

I see that the issue is closed but I have not found any work around. How did you solve?

Thanks

@aylei
Copy link
Owner

aylei commented Mar 13, 2019

@gadiener
Which version are you using?

@gadiener
Copy link
Contributor

@aylei
Copy link
Owner

aylei commented Mar 14, 2019

@gadiener
Would you like to try out the 0.0.2 release, auth problem got fixed in this version.

@gadiener
Copy link
Contributor

Thanks @aylei,

I sent you a pull request to update the README.md with the link of the new release.

#24

@deeTEEcee
Copy link

Following the binary instructions for mac installation on the README, I get an issue with tar file: tar: Error opening archive: Unrecognized archive format

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

4 participants