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

[windows] Kubens doesn't work while kubectx works in binary version 9.0 #233

Closed
eshepelyuk opened this issue May 28, 2020 · 4 comments
Closed

Comments

@eshepelyuk
Copy link

eshepelyuk commented May 28, 2020

I'm windows user and using msys2 as a linux like env, using its bash as my shell.
Also I'm using kubectl installed by chocolatey.

I've been using kubectx and kubens in bashform for about a year - without any problems.
So I've tried to download a new inary version recently and try it.

So, kubectx just works - no issue so far, but surprisedly kubens fails with following error

/d/projects
$ kubens
error: could not list namespaces (is the cluster accessible?): failed to initialize config: invalid configuration: unable to read certificate-authority testcluster.nas.local.crt for testcluster.nas.local due to open testcluster.nas.local.crt: The system cannot find the file specified.

/d/projects
$ kubectx
hrzn-dev-stage-k8s.nas.local
hrzn-prod-k8s.hrzn.prod
minikube
testcluster.nas.local

@ahmetb - please let me know how can I help to debug the issue, what are the missing details.

Environment:

  • windows 10
  • kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.6", GitCommit:"7015f71e75f670eb9e7ebd4b5749639d42e20079", GitTreeState:"clean", BuildDate:"2019-11-13T11:11:50Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}
@ahmetb
Copy link
Owner

ahmetb commented May 28, 2020

First of all it’s definitely funny that suddenly within 10 minutes two msys2 users show up :)

If one of you can run with DEBUG=1 set as env var, I think we can get some more out of it.

From the error, I am suspecting this is because there are some CA cert paths in kubeconfig path that are not working. This sounds similar to #229.

@eshepelyuk
Copy link
Author

eshepelyuk commented May 28, 2020

Hi @ahmetb

First of all it’s definitely funny that suddenly within 10 minutes two msys2 users show up :)

we're colleagues

If one of you can run with DEBUG=1 set as env var, I think we can get some more out of it.

Here's output

/d/projects
$ env DEBUG=1 kubens
error: could not list namespaces (is the cluster accessible?): failed to initialize config: invalid configuration: unable to read certificate-authority testcluster.nas.local.crt for testcluster.nas.local due to open testcluster.nas.local.crt: The system cannot find the file specified.
[DEBUG] error: invalid configuration: unable to read certificate-authority testcluster.nas.local.crt for testcluster.nas.local due to open testcluster.nas.local.crt: The system cannot find the file specified.
failed to initialize config
main.queryNamespaces
        /home/runner/work/kubectx/kubectx/cmd/kubens/list.go:63
main.ListOp.Run
        /home/runner/work/kubectx/kubectx/cmd/kubens/list.go:37
main.main
        /home/runner/work/kubectx/kubectx/cmd/kubens/main.go:20
runtime.main
        /opt/hostedtoolcache/go/1.14.2/x64/src/runtime/proc.go:203
runtime.goexit
        /opt/hostedtoolcache/go/1.14.2/x64/src/runtime/asm_amd64.s:1373
could not list namespaces (is the cluster accessible?)
main.ListOp.Run
        /home/runner/work/kubectx/kubectx/cmd/kubens/list.go:39
main.main
        /home/runner/work/kubectx/kubectx/cmd/kubens/main.go:20
runtime.main
        /opt/hostedtoolcache/go/1.14.2/x64/src/runtime/proc.go:203
runtime.goexit
        /opt/hostedtoolcache/go/1.14.2/x64/src/runtime/asm_amd64.s:1373

@ahmetb
Copy link
Owner

ahmetb commented May 28, 2020

we're colleagues

I highly recommend not doing this in open source repositories.
This falsely makes maintainers think you’re two independent parties ran into this issue, which may indicate it's a widespread problem (although msys user base is probably small). So it's better not to exhibit this form of +1'ing in open source.

I’m suspecting this is indeed #229. When you go to the directory that contains the testcluster.nas.local.crt and run kubens, does it work? If so, that's the same issue.

@eshepelyuk
Copy link
Author

@ahmetb yes - you're right. Closing this in favour of #229

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