-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-Interface doesn't work if using network_mode stanza in docker driven task #10010
Comments
Confirming.
Might look like this:
Such configuration would allow using cni-bridge with the docker's bridge, since address ranges from the docker and from the nomad(cni) don't overlap ( |
I've verified this as well. On my test machine here I've configured
I ran @Davasny's job and got the following output of {
"Bridge": "",
"SandboxID": "f437c26be10275780d63a6401abd08acf7201dfba97eebe2f70880806b2fd7a6",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/f437c26be102",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"test": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"628398ff5f5b"
],
"NetworkID": "d7837cb435447312314c7b7c3b9169a19a687458e6dac5490a77390ef61e94ab",
"EndpointID": "669a22e9c95aca0b61f2049613619a4606e7f566f3f5fc93eda6027bab375fde",
"Gateway": "192.168.17.1",
"IPAddress": "192.168.17.2",
"IPPrefixLen": 24,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:c0:a8:11:02",
"DriverOpts": null
}
}
} However I'm sorry to say I think you've run into a known limitation. From the network docs on host networks:
The example there could be more comprehensive but this looks like another case of the same issue. I'd have thought we'd have an issue open for it, but other than other reports like #10001 and #9006 it doesn't look like it. I'll circle up with the original author of this feature to make sure I understand whether the limitation is inherent or just "not done yet". And in the meanwhile, I'll try to make sure this gets surfaced for our roadmapping to fix. |
Ok, had a chat with some folks internally here and this is indeed a known limitation. When you set the So there's a documentation bug here to fix. The snippet of documentation I quoted above is also wrong when it comes to port mapping; that should all work now. Going to mark this as a docs bug and will ship a PR to clean this all up. |
Documentation fixes are merged and will go out with the next website push. |
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
If filing a bug please include the following:
Nomad version
Operating system and Environment details
Issue
When using multi-interface feature it's possible to access container port via public IP, but after enabling
network_mode
in task config, container becomes unaccessible.Reproduction steps
network_mode = "test"
network_mode = "test"
and rerun the job# curl 192.168.88.248:8001 curl: (7) Failed to connect to 192.168.88.248 port 8001: Connection refused
Network config
# ip -br a lo UNKNOWN 127.0.0.1/8 ::1/128 eth0 UP 192.168.88.250/24 fe80::215:5dff:fe0b:ac0f/64 eth1 UP 192.168.88.248/24 fe80::cf0d:e1a4:47ca:2036/64 docker0 DOWN 172.17.0.1/16 fe80::42:93ff:fea0:c016/64 nomad UP 172.26.64.1/20 fe80::5042:c1ff:fe01:8283/64 br-517e1d2d528e UP 172.19.0.1/16 fe80::42:e8ff:fe51:3ae4/64
Job file (if appropriate)
Nomad config
Alloc status after step 5 in reproduction
Clone of: https://discuss.hashicorp.com/t/question-how-to-run-task-in-multi-interface-configuration-with-access-to-docker-network/20768
Same issue had @urusha in #8432
The text was updated successfully, but these errors were encountered: