-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
remove trailing dots from the parsed searches from host resolv.conf #83069
remove trailing dots from the parsed searches from host resolv.conf #83069
Conversation
Welcome @fcgravalos! |
@fcgravalos: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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. |
Hi @fcgravalos. 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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/sig network |
/release-note-none |
/assign @freehan |
after this #74686 got merged maybe removing "all" the trailing dots in the However, based on the assumption that a domain with or without trailing dot in the search field is the same #74685 (comment), maybe we can consider as a duplicate a suffix with and without a trailing dot. |
Another option I considered was changin |
PR #74686 allows trailing dots in searches. It added the comment Removing all trailing dots in the searches is also just a "normalization" and not in conflict with #74686. Although having a trailing dot in the searches is wrong already, it is good behavior to still accept and normalize (ignore) it. |
Hi @freehan !! 👋 Do you have an estimate about when this can be tested? I ran Thanks a lot!! |
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.
/ok-to-test
/lgtm
From my reading of the conversation, I think this looks good to me. Worth adding a comment explaining why we strip the "." (or alternatively extracting the code into a function with a descriptive name (i.e. removeRedundantTrailingPeriod
)).
/retest |
b35e708
to
52dbfdf
Compare
52dbfdf
to
c959b5e
Compare
/retest |
tests failing because:
I'll try again later |
/retest |
It seems we're still hitting gcloud routers limits |
/retest |
Finally al tests passed @johnbelamaric :) |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fcgravalos, johnbelamaric The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@johnbelamaric do you think it makes sense to cherry-pick this to recent releases (>=1.15)? |
Oddly it's marked as kind/feature here, not kind/bug. But I would consider it a bug. It can certainly cause hard-to-identify DNS related production issues. So, I think it would makes sense to cherry pick. |
@johnbelamaric is it possible to label it at this point as |
Certainly It is not a feature :). But on the other hand I was not sure of considering this a bug... I think I should have brought Up that discussion when I opened the PR. |
/kind bug |
/remove-kind feature |
/priority important-soon |
Thanks @johnbelamaric |
What type of PR is this?
/kind feature
What this PR does / why we need it:
In short: This will make kubelet ignore trailing dots
.
in search lines from host resolv.conf files, so whenomitDuplicates
function gets called, is de-duplicated and we don't hit validation limits. PleaseLong story: We provision our Debian stretch based clusters (1.15.3) with kubespray, which supersedes search lines to add
svc.clusterFqdn
anddefault.svc.clusterFqdn
to the host resolvconf conifg file (/etc/resolv.conf
).https://github.com/kubernetes-sigs/kubespray/blob/da50ed0936742bb633c6b48a84ffca98d8ab03ad/roles/kubernetes/preinstall/tasks/0040-set_facts.yml#L121
When a server restart, dhclient runs, adds trailing dots are added to those search lines.
When a pod with DNS policy
ClusterFirst
gets scheduled, kubelet will addsvc.clusterFqdn
andnamespace.clusterFqdn
to the podresolv.conf
and it will be merged with the hostresolv.conf
deduplicating entries and doing limit validations.kubernetes/pkg/kubelet/network/dns/dns.go
Line 146 in 26cc580
kubernetes/pkg/kubelet/network/dns/dns.go
Line 85 in 26cc580
kubernetes/pkg/kubelet/network/dns/dns.go
Line 98 in 26cc580
So, if the search line now contains trailing
.
, and you have things likesvc.clusterFqdn.
when scheduling a pod,svc.clusterFqdn
andsvc.clusterFqdn.
are not deduplicated and you can hit one of the validation limits (MaxDNSSearchPaths) and the resulting line may be cut down to this limit, 6.In our case it removed our search for services outside our kubernetes cluster, so dns request were not sent to upstream resolver and we had some timeouts affecting our production workload.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
NOTE I'm not saying this is a bug. Adding trailing dots to search lines don't provide any values, but it is harmless, and I think it'd would be nice that kubelet can detect them and remove them so we don't have garbage in pod resolv.conf or we hit a validation limit.
Some facts:
v1.15.3
4.19.0-0.bpo.4-amd64 #1 SMP Debian 4.19.28-2~bpo9+1 (2019-03-27) x86_64 GNU/Linux
Does this PR introduce a user-facing change?:
NONE
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: