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
Avoid propagating "search ." into containers /etc/resolv.conf #112157
Conversation
@dghubble: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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 @dghubble. 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. |
/cc aojea dcbw |
We can't just revert it. The revert-state is ALSO a bug. It's obviously a MUSL bug, the question is whether we should "fix" this by simply removing any search item which is Thoughts? |
searches = []string{}
for _, s := range fields[1:] {
if s != "." {
- s = strings.TrimSuffix(s, ".")
+ searches = append(searches, strings.TrimSuffix(s, "."))
}
- searches = append(searches, s)
}
} |
Agreed, #109441 seems to be trying to trying to prevent an empty entry. We could solve this differently than propagating "." and confusing musl. I'll update with your suggestion |
Updated title, description, and code/tests. |
{"search ", []string{}, []string{}, []string{}, false}, // search empty | ||
{"search .", []string{}, []string{"."}, []string{}, false}, | ||
{"search ", []string{}, []string{}, []string{}, false}, // search empty | ||
{"search .", []string{}, []string{}, []string{}, false}, // ignore lone dot |
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.
Can you please add cases for "search . foo" -> ["foo"] and "search foo ." (same) and "search foo . bar" -> ["foo", "bar"].
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.
added
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.
Did you test this witrh a MUSL container?
{"search ", []string{}, []string{}, []string{}, false}, // search empty | ||
{"search .", []string{}, []string{"."}, []string{}, false}, | ||
{"search ", []string{}, []string{}, []string{}, false}, // search empty | ||
{"search .", []string{}, []string{}, []string{}, false}, // ignore lone dot |
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.
Can you please add cases for "search . foo" -> ["foo"] and "search foo ." (same) and "search foo . bar" -> ["foo", "bar"].
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.
added
* Adapt kubernetes#109441 but ensures that `search .` does not get propagated into containers' /etc/resolv.conf. There is no reason to put `.` in a container's search field and it causes issues for musl
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.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dghubble, thockin 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 |
if no NAK in a day or two, go ahead and remove hold |
I've not built a cluster from this PR. But I've fiddled with this a good bit to discover this 😢 . For my part, in Typhoon I'm working around it by removing "search ." from hosts which works. I also found manually removing the "." from inside alpine (or similar) containers would fix them, as would removing ndots (undesired). And reverting to Kubelet v1.24.4 also fixed (bc the "." doesn't propagate). So I'm hopeful this is the thing! |
/retest |
+1
|
I see the cherry-pick deadline for 1.25.1 is on 2022-09-09 (a week from now). |
/hold cancel |
The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass. This bot retests PRs for certain kubernetes repos according to the following rules:
You can:
/retest |
I proposed this for 1.25.1, cherry-pick at #112204. |
…7-upstream-release-1.25 Automated cherry pick of #112157: Avoid propagating `search .` into containers /etc/resolv.conf
* Kubelet v1.25.1 has the fix kubernetes/kubernetes#112157
* Kubelet v1.25.1 has the fix kubernetes/kubernetes#112157
* Kubelet v1.25.1 has the fix kubernetes/kubernetes#112157
Starting in Kubelet v1.25.0, on certain hosts (those with a FQDN hostname and recent systemd), a "search ." in
/etc/resolv.conf
will now propagate into containers (it did not before v1.25). This breaks musl-based DNS resolution (e.g. any alpine image) for Pods running on such nodes.#112135 provides a lot of details.
What type of PR is this?
/kind bug
/kind regression
What this PR does / why we need it:
This reverts commit 5832b84 to fix a regression introduced in v1.25.0 (v1.25.0-alpha.1 to be specific). Without this change. alpine or other musl-based containers will fail DNS resolution on certain nodes (described in issue).Adapts #109441 to avoid propagating
search .
into containers/etc/resolv.conf
Which issue(s) this PR fixes:
Fixes #112135
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
Historical: