-
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
incorrect advertisement w/ host_network #10001
Comments
Hi @mr-karan! A few questions that might help narrow this down:
|
Possible duplicate of #9006 |
I am able to reproduce this. The only change I did:
Yep. It's infact a Pihole that I'm running. So I did a few quick Port 53:
Port 80:
And now here's the strange part. Port 443 (which is the one I changed in
I tried to do The problem disappears when I do a fresh deployment:
Let me know please if any further steps you'd like me to perform to narrow down the issue. |
I think I've also run into the same thing. This is my Nomad config:
which seems to be necessarity as Vagrant hogs eth0. The job specifies the
And the docker driver does use the correct/expected ip/port allocation:
While on the other hand Nomad pushes the following allocation to Consul
The very least the allocation should match what the docker driver is running. |
I am able to reproduce this on Nomad v1.0.3, but not able to reproduce on 1.2.x+. I'll spend a bit more time trying to bisect when this was fixed but unless folks are still seeing the behavior on a supported Nomad version I think we can close this out. Create network
nomad.hcl server {
enabled = true
}
client {
enabled = true
host_network "mynet" {
cidr = "10.0.0.1/24"
reserved_ports = 22
}
} Start nomad & consul
example.nomad job "example" {
datacenters = ["dc1"]
group "cache" {
network {
port "db1" {
to = 6379
host_network = "mynet"
}
port "db2" {
to = 9999
host_network = "mynet"
}
}
service {
name = "redis"
port = "db2"
}
task "redis" {
driver = "docker"
config {
image = "redis:7"
ports = ["db1", "db2"]
auth_soft_fail = true
}
resources {
cpu = 100
memory = 32
}
}
}
} first run
modify service port label
check networks again, they have changed (!)
After running through these steps on 1.2.15, 1.3.8, 1.4.3, and 1.4.4-dev the addresses remain correct after doing the update. @tcurdt were you seeing that wrong address after an update to the |
@shoenig Unfortunately it's been too long since and I cannot really answer that question anymore. |
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
Issue
I've configured
host_network
on my client's config like:After deploying a task, when I viewed
nomad alloc status <id>
I noticed a strange thing:Here
68.x.y.4
is the public IPv4 of my server. But when I the same port mapping usingdocker ps
I observed a completely different (and correct) output:Reproduction steps
http
port instead ofhttps
.It might be hard to reproduce but definitely the wrong host address was mapped inside Nomad. I tried to change the Service multiple times but couldn't reproduce this.
Job file (if appropriate)
The text was updated successfully, but these errors were encountered: