Nomad, WSL and bridge networking

Hi all,

I’m running the vanilla ubuntu nomad from the online tutorial and I’m running into network issue.

Specifically, docker backed services gets bound to the 127.0.0.1 IP, which makes them un-accessible from other service containers.

As mentioned in other posts (Nomad service address resolves to localhost ) , I’ve tried using the bridge network type with the address_mode = alloc setting, but no joy.

I think I traced it down to the fact that the bridge network mode gets disabled in nomad due to:


2023-05-24T13:10:35.635+0100 [DEBUG] client.fingerprint_mgr: built-in fingerprints: fingerprinters=["arch", "bridge", "cgroup", "cni", "consul", "cpu", "host", "landlock", "memory", "network", "nomad", "plugins_cni", "signal", "storage", "vault", "env_aws", "env_gce", "env_azure", "env_digitalocean"]
   2023-05-24T13:10:35.636+0100 [WARN]  client.fingerprint_mgr: failed to detect bridge kernel module, bridge network mode disabled:
error=
| 3 errors occurred:
| \t* module bridge not in /proc/modules
| \t* failed to open /lib/modules/5.15.90.1-microsoft-standard-WSL2/modules.builtin: open /lib/modules/5.15.90.1-microsoft-standard-WSL2/modules.builtin: no such file or directory
| \t* failed to open /lib/modules/5.15.90.1-microsoft-standard-WSL2/modules.dep: open /lib/modules/5.15.90.1-microsoft-standard-WSL2/modules.dep: no such file or directory
|

On a side node, bridge networks work just fine using docker-compose, so I assume nomad’s bridge network is something more general as it covers more than just docker containers.

Is there a way to setup nomad so it activates bridge networking on WSL?

Thanks!

1 Like

Hello @jeteve!

I had replied to you in this post.

All steps are better explained in my git repository

After applying the steps, you can optionally install bridge-utils to be able to see which virtual interfaces are associated with a bridge:

sudo apt install bridge-utils
brctl show

before

deploying service mesh demo and show new interfaces

show bridges

service mesh working

services in consul

Have fun!

Thanks! I managed to get bridge mode working on WSL. From my findings, I think my issue is that nomad assigns the loopback IP for services, which doesn’t allow other containers (from other jobs) to access such services.

This doesn’t seem to be the case when nomad runs on an actual Linux machine (virtual or not).

I think I found a solution.

In my WSL, I now have:

1 Like