-
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
CLI displays reports host_network configuration and not fingerprint #11671
Comments
Also interesting ReservedPorts shows even if there are global reservations set:
On one hand the reserved ports aren't network specific so that makes sense not showing, on the other hand the global reserved ports don't appear to show anywhere else instead either. I haven't done testing to see if the reservations are actually working or not. I can open a separate issue for this if it's not just me being blind and missing it in the output. |
Hi @nvx! Thanks for opening this issue! I was able to reproduce fairly easily using our Vagrant environment. With the following configuration on a host that has the IP 10.0.2.15/24 on eth0: client {
enabled = true
host_network "specific_ip" {
cidr = "10.0.2.15/24"
reserved_ports = "22"
}
host_network "should_not_match" {
cidr = "10.199.0.0/24"
}
host_network "should_match" {
cidr = "10.0.2.0/24"
}
} I'm getting the following, none of which is correct:
I tried removing the less specific matching (ex. remove the However, when I try to actually run a job that uses one of the invalid host networks, the scheduler rejects it! jobspecjob "example" {
datacenters = ["dc1"]
group "web" {
network {
mode = "bridge"
port "www" {
to = 8001
host_network = "should_not_match"
}
}
task "http" {
driver = "docker"
config {
image = "busybox:1"
command = "httpd"
args = ["-v", "-f", "-p", "8001", "-h", "/local"]
ports = ["www"]
}
template {
data = "<html>hello, world</html>"
destination = "local/index.html"
}
resources {
cpu = 128
memory = 128
}
}
}
}
This leads me to believe the CLI may be returning the client configuration here and not the actual fingerprint. So then I looked at the API and it looks like that's exactly it. Compare the following two blocks:
So there's a bug here in how we're presenting the results from the API in the CLI, but fortunately the actual fingerprint that's reaching the server reflects the fingerprint. But there's also a bug though in that the I'm going to keep this issue open to cover the CLI reporting correctly, and we'll deal with the reserved port issue in that issue. I've renamed the issue title for clarity and I'll mark this for roadmapping. |
Ah nice catch! A CLI bug is a lot less concerning than the fingerprinting being wrong. Having a look at my nodes, the node info .NodeResources.NodeNetworks json path shows the expected info which confirms your findings. |
Nomad version
Nomad v1.2.2 (78b8c17)
Operating system and Environment details
Linux x64 (mix of RHEL and Alpine)
Issue
The documented behaviour at https://www.nomadproject.io/docs/configuration/client#host_network-stanza doesn't appear to be what happens in practice:
Specifies a cidr block of addresses to match against. If an address is found on the node that is contained by this cidr block, the host network will be registered with it.
Reproduction steps
On a host with eth0 having an IP of 10.1.2.52 and no other interfaces (except the default loopback/etc)
With the following Nomad client config:
Doing a
node status -verbose <node-id>
results in the following output:Expected Result
I would have expected only "default" and "test2" host networks to appear.
Actual Result
All networks from the config file appear.
The text was updated successfully, but these errors were encountered: