Everything was working, but I wanted to upgrade to Ubuntu 20.04, since 16.04 was now EOL. I’m having trouble getting DNS lookup to work in the Docker containers. In other words, lookup of, say, “postgres.service.consul” isn’t working.
Some background:
I got rid of systemd-resolved on these systems, and consul is listening on on port 53 (on all machines, both nomad servers and clients)
Consul is started with: /usr/local/bin/consul agent -config-dir=/etc/consul.d -dns-port=53 -recursor=172.31.0.2
On the Nomad client, a ‘dig postres.service.consul’ will return the IP of the container. But inside the container, the lookup fails. However, inside the container I can look up non-cluster address, e.g. google.com
/etc/resolv.conf on the host:
nameserver 172.17.0.1
/etc/resolv.conf in the container:
nameserver 172.31.0.2
But if I change it to 172.31.0.1 inside the container, it still will not lookup, and in fact times out.
I’m sure I’m missing something simple, but I don’t know what.
Any other troubleshooting information I can dig up?
Ah, just realized the docker container is getting set to the recursor setting. Why isn’t it getting 172.17.0.1 from docker. I’ll have to investigate more.
Welp!! Solved it. While I’m not sure why this wasn’t needed under Ubuntu 16.04, the solution was to restart dockerd after modifying the resolv.conf file so it would pick up the changes and pass them in to newly created containers.
Running into this issue as well, did you find a solution? I am not able to reach any services using the *.service.consul addresses inside containers that are spun up by Nomad. This works in ubuntu 16.04 but not on ubuntu 20.04. Any help greatly appreciated.