This repository has been archived by the owner on Dec 7, 2023. It is now read-only.
Fix containerd resolv.conf + DHCP behavior #441
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #437
Patches:
Having the user be able to setup custom DNS is great, but it would be better if it first worked well without any tweaking.
This resolv.conf library supports
/etc/resolv.conf
, systemd-resolved, and will even work with nothing at all.All loopback nameservers are filtered, and in the event that there's still no usable DNS, it falls back to Google DNS servers. (other default suggestions are welcome)
The containerd runtime then uses this lib to populate the vmDir specfic to the ignite vm's id.
A modification to the runtime interface was needed to pass the id so this could be done.
It might be better to try and use the container's snapshot instead of the vmDir to accomplish this.
However, using the vmDir is a generic solution since adding mounts for the runtime container is simple.
We could use this mechanism to more uniformly configure DHCP /w docker while disabling the default resolver for ignite-spawn as mentioned in #438.
I'd also be fine not actually writing any file and just adding fields to the vm manifest for
dhcp.Nameservers
anddhcp.Search
.We can still use readDNSConfig() and its accompanying functions to calculate the proper values from the host.
The benefit of using
/etc/resolv.conf
is it's well integrated with docker networks which the vm will benefit from through it's DHCP config.example behavior: