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

Ingress DNS documentation lacks instruction for Linux OS systemd-resolved (relevant to Ubuntu) #18727

Open
gpelouze opened this issue Apr 23, 2024 · 4 comments · May be fixed by #18728
Open

Comments

@gpelouze
Copy link

The Ingress DNS documentation has instruction for adding the minikube ip as a DNS server ("Installlation", step 3). Under the Linux tab, it provides instructions to do so for systems using resolvconf and Network Manager, but not systemd-resolved. This is relevant because it seems to be used by Ubuntu>=22.04 (/etc/resolv.conf starts with # This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8).)

On systems using systemd-resolved, the minikube IP can be added by running:

sudo mkdir /etc/systemd/resolved.conf.d
sudo tee /etc/systemd/resolved.conf.d/minikube.conf << EOF
[Resolve]
DNS=$(minikube ip)
Domains=~test
EOF
sudo systemctl restart systemd-resolved

I propose to create a PR to add this to the documentation.

@cirix
Copy link

cirix commented Apr 23, 2024

Bare in mind that will not work for for everyone, for example on MacOSX you need to create a resolver for the domain you want. On top I think configuring the systemd-resolve tool to add entries is straightforward. I think what requires update is the fact that still it's referencing on the documentation to edit /etc/resolve.conf and in no *nix based system that file is now self managed. Is automatically generated. That needs to be maybe remarked.

@llegolas
Copy link

llegolas commented May 4, 2024

you need to restart systemd-resolved after that .
But there are few (wrong) assumptions here.
Firstly it assumes that minikube is running at the time systemd-resolved is (re)started and secondly it assumes that $(minikube ip) will fetch the IP of your instance without knowing which user you might be.

@medyagh
Copy link
Member

medyagh commented May 7, 2024

if this step is required for the linux users, we should consider to add this to the Addon itself, maybe to add this step automatically, what do you think ?

@gpelouze
Copy link
Author

gpelouze commented May 8, 2024

@medyagh: this step is not required for all linux users, but depends on the system's DNS configuration. Here are the steps one should follow to address step 3 "Add the minikube ip as a DNS server" on any Linux distribution:

  1. Determine the DNS setup. This can usually be done by looking at the first lines of /etc/resolv.conf. I know of three options (there might be more):
  • mentions resolvconf → use instructions "Linux OS with resolvconf" from the current Ingress DNS documentation
  • # Generated by NetworkManager → use instructions "Linux OS with Network Manager" from the current doc
  • # This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8). → use instructions "Linux OS with systemd-resolved" from the linked PR.
  1. Start minikube (thanks @llegolas for identifying that it is missing from the doc)
  2. Follow the instructions from the appropriate section

The current documentation does not explain clearly that one needs (1) to identify the DNS config, and (2) only apply the instructions for this config.

Automation sounds difficult and risk having unexpected consequences, as it would need correctly to handle any possible DNS configuration. (There is a related TODO on the same page.) I think it outside of the scope o this issue.

I will update the PR with @medyagh's comments and clarify the issues raised above (identify the right setup, and start minikube before applying the modifications).

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

Successfully merging a pull request may close this issue.

4 participants