You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
root@lim1:~/test$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a8b0743e8173 bunkerity/bunkerized-nginx "/opt/entrypoint.sh" 55 seconds ago Up 54 seconds 80/tcp, 443/tcp nginx-fcb299df-c234-637c-98d2-82adb98022d2
I expected that my nginx will be work on public ip and use port 8080 instead 80 which set in docker container.
Nomad version
Nomad v0.12.5
Operating system and Environment details
Debian 5.7.10-1~bpo10+1
Issue
Reproduction steps
create in client config host_network and launch job.
Job file (if appropriate)
job "nginx-revers-proxy" {
datacenters = ["dc1"]
group "nginx" {
count = 1
network {
port "admin" {
to = 8080
static = 80
host_network = "public"
}
}
service {
name = "nginx"
port = "admin"
}
task "nginx" {
driver = "docker"
config {
image = "bunkerity/bunkerized-nginx"
volumes = [
"local:/etc/nginx/conf.d",
]
}
template {
data = <<EOF
events {}
http {
server {
location / {
proxy_pass http://nomad-ws;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Nomad blocking queries will remain open for a default of 5 minutes.
# Increase the proxy timeout to accommodate this timeout with an
# additional grace period.
proxy_read_timeout 310s;
# Nomad log streaming uses streaming HTTP requests. In order to
# synchronously stream logs from Nomad to NGINX to the browser
# proxy buffering needs to be turned off.
proxy_buffering off;
# The Upgrade and Connection headers are used to establish
# a WebSockets connection.
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# The default Origin header will be the proxy address, which
# will be rejected by Nomad. It must be rewritten to be the
# host address instead.
proxy_set_header Origin "${scheme}://${proxy_host}";
}
}
upstream nomad-ws {
ip_hash;
server 10.222.3.204:4646;
server 10.222.0.31:4646;
server 10.222.3.128:4646;
}
}
EOF
destination = "local/nomad-revers.conf"
change_mode = "signal"
change_signal = "SIGHUP"
}
resources {
network {
mbits = 100
}
}
}
}
}
The text was updated successfully, but these errors were encountered:
Hi @zakabluk! I suspect this was fixed by #8822, which hasn't made it into the changelog for the upcoming 0.13.0 yet. Can you try this same jobspec against the current master?
@zakabluk just wanted to follow up on this. With the current Nomad 1.0.0-rc I was able to verify this works. Something I noticed while trying it was that you don't have a ports configuration for the container, so Docker isn't getting the port mapping you need. See this simplified example:
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 you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
I try use multi network. I have two network interfaces. I created host_network at client configuration.
And added to job file config
and afrer launched my job I got:
but when I get information about docker container
I inspected my monad job
I expected that my nginx will be work on public ip and use port 8080 instead 80 which set in docker container.
Nomad version
Nomad v0.12.5
Operating system and Environment details
Debian 5.7.10-1~bpo10+1
Issue
Reproduction steps
create in client config host_network and launch job.
Job file (if appropriate)
The text was updated successfully, but these errors were encountered: