We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
demo job:
job "redis-host" { datacenters = ["dc1"] type = "service" group "redis-host" { count = 1 network { mode = "host" port "redis" { to = 6349 } } task "redis-host" { env { PORT = "${NOMAD_PORT_redis}" NODE_IP = "${NOMAD_IP_redis}" } driver = "podman" config { image = "redis" cap_add = ["NET_RAW"] # this line is comment out to demo the problem # network_mode = "host" command = "redis-server" args = ["--port", "6349"] } } } }
the container actually runs in a bridged network (the default podman bridge network)
podman
do some digging, I found that,
the condition is we did not set driverConfig.NetworkMode (I want its value passed from group - network - mode ).
driverConfig.NetworkMode
group - network - mode
if group - network - mode is set to host, nomad will not set cfg.NetworkIsolation, so it is nil thus the logic goes here
host
cfg.NetworkIsolation
nil
nomad-driver-podman/driver.go
Lines 468 to 483 in 7e3d018
so here is the problem. when we need host network mode, we need set this both in group - network - mode and driver's config - network_mode.
config - network_mode
The text was updated successfully, but these errors were encountered:
Hello from 2024, this bug is still here.
I want to note that current behavior contradicts documentation that explicitly says:
By default the task uses the network stack defined in the task group network block.
There is also a confusing part in the same documentation:
If the groups network behavior is also undefined, it will fallback to bridge in rootful mode or slirp4netns for rootless containers.
bridge
slirp4netns
This doesn't make any sense because you can't have group network undefined, it defaults to host.
Sorry, something went wrong.
No branches or pull requests
demo job:
the container actually runs in a bridged network (the default
podman
bridge network)do some digging, I found that,
the condition is we did not set
driverConfig.NetworkMode
(I want its value passed fromgroup - network - mode
).if
group - network - mode
is set tohost
, nomad will not setcfg.NetworkIsolation
, so it isnil
thus the logic goes here
nomad-driver-podman/driver.go
Lines 468 to 483 in 7e3d018
so here is the problem. when we need
host
network mode, we need set this both ingroup - network - mode
and driver'sconfig - network_mode
.The text was updated successfully, but these errors were encountered: