Describe the bug
The issue described: https://github.com/kubernetes/kubectl/issues/48
And solution already implemented in kubectl: https://github.com/kubernetes/release/issues/469
Kubectl works fine, but lens doesnt
On macOS, if a Go program is compiled with CGO_ENABLED=0 then Go uses its own internal network name resolver. This resolver only knows about /etc/resolv.conf and doesn鈥檛 know about the libSystem (macOS libc) library and its name resolution functions.
macOS (like most modern OSes) has smarter DNS lookups than just using an /etc/resolv.conf which allows it to smoothly handle switching networks.
When a VPN is being used then DNS lookups will be split between the VPN鈥檚 DNS servers and your ISP鈥檚 DNS servers, depending on the hostname.
You can set up custom name servers for certain domains by creating resolv.conf style files in /etc/resolver/
This issue can be reproduced by creating /etc/resolver/
To Reproduce
Steps to reproduce the behavior:
Or
Expected behavior
The same behavior as for kubectl - I can work with cluster.
Screenshots
Environment (please complete the following information):
Logs:
When you run the application executable from command line you will see some logging output. Please paste them here:
Connecting ...
Authentication proxy started
2020/08/19 18:47:39 http: proxy error: dial tcp: lookup api.cluster.example.com on 192.168.1.1:53: no such host
Lens is using upstream kubectl binaries and those have this limitation. Lens project probably needs to build own kubectl binaries with right build flags.
@jakolehm
I've installed kubectl from brew (brew install kubectl) and it works fine:
> kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.8", GitCommit:"9f2892aab98fe339f3bd70e3c470144299398ace", GitTreeState:"clean", BuildDate:"2020-08-14T11:09:22Z", GoVersion:"go1.14.7", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"17+", GitVersion:"v1.17.1+b83bc57", GitCommit:"b83bc57", GitTreeState:"clean", BuildDate:"2020-07-30T20:54:30Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
Maybe there any way to switch to brew kubectl?
This helps me as a workaround:
cp /usr/local/bin/kubectl ~/Library/Application\ Support/Lens/binaries/kubectl/1.17.4
Maybe the fix is available on 1.18 version for kubectl.
Withe Lens 3.6.0, I can workaround by setting the _Path to Kubectl binary_ to /usr/local/bin/kubectl (ie homebrew) in Lens...Preferences
Withe Lens 3.6.0, I can workaround by setting the Path to Kubectl binary to /usr/local/bin/kubectl (ie homebrew) in Lens...Preferences
It looks like a solution, isn't it?
Dunno about a "solution" since it's still broken out of the box.
I guess Lens could bundle the Homebrew kubectl binary on macOS instead of the upstream one (until upstream gets fixed)
Most helpful comment
This helps me as a workaround: