-
Notifications
You must be signed in to change notification settings - Fork 2.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
Validate resolv.conf for presence of nameserver entries #9874
Comments
Hi, I would love to contribute to this one if this gets accepted. |
I’m glad you’ve taken notice of this issue. I believe we can enhance it together through discussion.
|
I think that's a fine place to do it. As far as k3s is concerned, not having any upstream is just as invalid as having multicast/loopback upstreams.
K3s has always done this, but you're correct that we could probably enhance the documentation to cover the behavior. As far as why it does it - many hosts use systemd-resolved or another local stub resolver. This does not work within pods, as the loopback address used for the stub is not reachable outside the host network namespace. Using a default upstream (8.8.8.8) in this case provides default behavior that works for most users. |
Kindly to ask if there is somebody working for this issue?If not I'm gald to undertake it. |
I see that you have already raised the PR, so yeah I think you can take it over. |
fixed here |
Is your feature request related to a problem? Please describe.
We are currently using k3s version 1.28.4 and have encountered an issue. If the /etc/resolv.conf file lacks any nameserver entries, the coredns pod fails to run. However, if the /etc/resolv.conf file is absent, coredns operates correctly.
Describe the solution you'd like
We suggest that if the /etc/resolv.conf file lacks any nameserver entries, the k3s agent should generate a resolv.conf file. This would allow coredns to run properly.
Describe alternatives you've considered
Upon examining the k3s code, we found a section in k3s/pkg/agent/config/config.go that validates the resolv.conf file. We propose adding a check here to validate the presence of nameserver entries in resolv.conf.
k3s/pkg/agent/config/config.go
Line 301 in f099bfa
Additional context
The text was updated successfully, but these errors were encountered: