kontena / kontena-plugin-azure

Azure provisioning plugin for Kontena
https://kontena.io
Apache License 2.0
0 stars 1 forks source link

cloud-init overwrite resolv.conf #18

Open jalberto opened 7 years ago

jalberto commented 7 years ago

The cloud-init file generated with this plugin overwrite resolv.cong but the original one says:

# This file is managed by systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known DNS servers.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 168.63.129.16
search bzf1w4dj231udmkfbgjjwbfhkd.ax.internal.cloudapp.net

Overwritting this file broke internal azure resolver, so other VMs cannot be accessed by name.

SpComb commented 7 years ago

Agreed that we should let systemd-resolved manage the /etc/resolv.conf and use the locally configured nameservers instead of always using 8.8.8.8. However, this needs something to ensure that the local 172.17.43.1 weave-dns resolver that knows about the kontena.local names is listed first in the generated /etc/resolv.conf, and it's not immediately obvious how to achieve that.

The different plugins are also inconsistent. Some of them overwrite the /etc/resolv.conf, others override the zz-default.network with [Network] DNS=172.17.43.1 DNS=... Domains=kontena.local. I'm not entirely sure how the later works, because the zz-default.network is not actually used on most platforms in preference to the per-link network units generated by the OEM cloudconfig..

It looks like the kontena-provided /etc/resolv.conf is also missing the search $GRID.kontena.local, which would also be useful.

jalberto commented 7 years ago

yep, really interesting problem.

In this case (azure) I think using kontena dns after azure will work as expected, as azure DNS will not have kontena domains configured and will try next DNS.

In other hand nsswitch can be tweaked for this