-
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
When running container via containerd-driver plugin in the bridge mode, there is no ip address(127.0.0.1/8) in the lo network #10014
Comments
I was able to confirm this same behavior with the Reproduction Here's a reproduction with your
From an jobspecjob "test3" {
datacenters = ["dc1"]
group "group" {
network {
mode = "bridge"
port "www" {
to = "8000"
}
}
task "group" {
driver = "exec"
config {
command = "python"
args = ["-m", "SimpleHTTPServer"]
}
}
}
}
A job with the
Docker on its own:
|
This issue persists with nomad v1.1.6. |
This problem replicates also for podman plugin. It works with service jobs but it is not supported with Consul Connect sidecar |
I also hit this issue on "Rocky Linux 8.5 (Green Obsidian)" with the most recent Nomad version and drivers (tested with the "podman" and "exec" drivers and Consul Connect). I've seen two workarounds so far:
I also tested the first approach via a similar Python script. Code#!/usr/bin/env python3
# dnf install python3
# dnf install python3-inotify # https://github.com/seb-m/pyinotify
# An alternative package (code not compatible): https://pypi.org/project/inotify/
import os
import pyinotify
class EventHandler(pyinotify.ProcessEvent):
def process_IN_CREATE(self, event):
netns = event.name
print (f"New netns: {netns}")
os.system(f"ip -n {netns} link set lo up")
def main():
handler = EventHandler()
# Instanciate a new WatchManager (will be used to store watches).
wm = pyinotify.WatchManager()
# Associate this WatchManager with a Notifier (will be used to report and
# process events).
notifier = pyinotify.Notifier(wm, handler)
# Add a new watch on $PATH for ALL_EVENTS.
wm.add_watch('/run/netns/', pyinotify.IN_CREATE)
# Loop forever and handle events.
notifier.loop()
if __name__ == '__main__':
main() But of course those workarounds are super hacky and it'd be great if this could be fixed properly. |
CNI changed how to bring up the interface in v0.2.0. Support was moved to a new loopback plugin. containernetworking/cni#121 Fixes hashicorp#10014
CNI changed how to bring up the interface in v0.2.0. Support was moved to a new loopback plugin. containernetworking/cni#121 Fixes #10014
Fixed by #13428, which will ship in Nomad 1.3.2 (+ backports) |
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. |
Nomad version
Operating system and Environment details
Ubuntu 18.04.3 LTS
Issue
When running container via
containerd-driver
plugin in the bridge mode, there is no ip address(127.0.0.1/8) in the lo network, so app can not listen on 127.0.0.1 .when change to docker driver, the lo network is fine.
I original issue the problem on nomad-driver-containerd, and @shishir-a412ed suggest me issue here.
As I test, the problem can be resolved by set the lo link in the netns up. Can we solve this problem in nomad? thanks.
Reproduction steps
Job file (if appropriate)
The text was updated successfully, but these errors were encountered: