wescale/hashistack

Nomad. External network not available (Could not resolve host) in bridge mode

Closed this issue · 0 comments

makp0 commented

More like a tip for others. May be worth adding to docs.

job "test" {
    datacenters = ["devone"]

    group "test_group" {
      	network {
            mode = "bridge"
            dns {
              servers = ["10.194.3.12", "10.194.3.3"]
    		}
        }

        task "clone_hashistack" {
            driver = "exec"
          	
            config {
                command = "/bin/bash"
                args    = ["-c", "rm -rf hashistack && git clone https://github.com/wescale/hashistack.git"]
            }
        }
    }
}

network.dns.servers = ["10.194.3.12", "10.194.3.3"] are specific to Scaleway.

Without them job will fail with:

Cloning into 'hashistack'...
fatal: unable to access 'https://github.com/wescale/hashistack.git/': Could not resolve host: github.com

Extracted by running resolvectl in a Scaleway instance:

resolvectl
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub

Link 2 (ens2)
Current Scopes: DNS
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 10.194.3.12
DNS Servers: 10.194.3.12 10.194.3.3

Idea for the fix taken from here