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

What is the reason behind CGO_ENABLED=0? #147

Open
bazhenov opened this issue Jul 1, 2021 · 0 comments
Open

What is the reason behind CGO_ENABLED=0? #147

bazhenov opened this issue Jul 1, 2021 · 0 comments

Comments

@bazhenov
Copy link

bazhenov commented Jul 1, 2021

I've facing problems using kubectl-debug with k8s cluster deployed in intranet. It boils down to kubectl-debug built with CGO_ENABLED=0 which disables host bases DNS-resolver.

Description of the problem

MacOS DNS resolver quite sophisticated (libc function gethostbyname()). It takes in consideration scoped DNS queries when connected over VPN. My workplace VPN has DNS zone .kube.private and macOS sends all *.kube.private DNS-queries to the VPN DNS server, not my ISP-provider one. But CGO_ENABLED=0 disables cgo and linking over libc, and there is no chance go-native DNS resolver will ever implement all the logic of macOS DNS resolver.

So, in the end I have somewhat frustrating somewhat funny behaviour – kubectl-debug says no such host, but I can ping it:

$ kubectl-debug search-sessions-backend-9b85975c4-xvrkr
Unable to connect to the server: dial tcp: lookup api.kube.private. on 192.168.1.1:53: no such host
$ ping api.kube.private.
PING api.kube.private (80.92.164.106): 56 data bytes
64 bytes from 80.92.164.106: icmp_seq=0 ttl=56 time=119.965 ms
...

I'm interested what are the reasons for using CGO_ENABLED=0? Does static linking so bad after all (at least under macOS)?

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

1 participant