-
Notifications
You must be signed in to change notification settings - Fork 40.3k
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
Fix the issue in Windows kube-proxy when processing unqualified name. This is for DNS client such as ping or iwr that validate name in response and original question. #45642
Conversation
…r validate name in response and original question. Switch to use miekg's DNS library
Hi @JiangtianLi. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
One side note, with rebasing the latest master, building Windows kube-proxy is broken due to #45554. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I didn't got a chance to test it manually on a Windows node.
I have NO IDEA what this code is doing - no other proxy mode has anything DNS related - can you explain what is happening here? Did you build a DNS server into kube-proxy? |
I'm going to approve this to unblock, but I'd like to discuss what the heck is going on here. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JiangtianLi, thockin
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@thockin Sorry, I should have more context here. This PR is an additional fix to #41618 and the corresponding commit. There is no new DNS server built into kube-proxy. The issue this PR and #41618 is trying to fix is that DNS suffix search list doesn't work in Windows container (--dns-search option from this link). Therefore lookup unqualified name such as To overcome that and until Windows releases container that fix DNS suffix search list issue, we have come up with a solution to fix in Windows kube-proxy. The idea is to have kubeproxy do what DNS client would do to search DNS suffix search list and append it to query, i.e., intercept DNS packet and append a list of common DNS suffix ("cluster.local", "svc.cluster.local", "default.svc.cluster.local", and host DNS suffix) to the name in DNS query. This has worked pretty well for most Windows user scenarios. Hope that clarifies a bit. Please let me know if you have any question. |
@JiangtianLi does that code belong in kube-proxy? It seems like something that could be a separate Windows only module that implements the *nix style resolv.conf behavior. |
@bowei Thanks for the suggestion. Yes, that code belongs to kube-proxy. The code is in the winuserspace part of the kube-proxy. So it is in Windows kube-proxy and separated from the *nix kube-proxy. |
Yeah, I find this exceptionally weird, but I am willing to grant latitude since it seems a) temporary and b) contained. Before long we need to really decide if it is worthwhile for the Window kube-proxy to actually be part of kube-proxy, or a separate thing. |
@k8s-bot gce etcd3 e2e test this |
@thockin Agreed that this fix is a workaround to get Windows scenario work. Windows's kube-proxy forked from kube-proxy and implemented a few Windows specific features. sig-windows folks should have more context. Thanks for the approval. I felt this fix should be with its precedent commit in the upstream rather than in my private branch separately. |
Automatic merge from submit-queue |
What this PR does / why we need it:
This PR is an additional fix to #41618 and the corresponding commit. The DNS client such as nslookup does not validate name matching in response and original question. That works fine when we append DNS suffix to unqualified name in DNS query in Windows kube-proxy. However, for DNS client such as ping or Invoke-WebRequest that validates name in response and original question, the issue arises and the DNS query fails although the received DNS response has no error.
This PR fixes the additional issue by restoring the original question name in DNS response. Further, this PR refactors DNS message routines by using miekg's DNS library.
This PR affects the Windows kube-proxy only.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #42605Special notes for your reviewer:
Release note: