client network_interface
fingerprinting incorrect/unintended IP address in unique.network.ip-address
#20562
Labels
Projects
Nomad version
Operating system and Environment details
Debian 11 on Linode (with Linode's Network Helper enabled)
Issue
TLDR; Nomad client network_interface should allow for selection of a different addr resource within the same interface
Nomad is hard-coded to select the first addr in client's network_interface (which is used to fingerprint for
unique.network.ip-address
).This behaviour renders nomad unusable for certain networking configurations. e.g. Linode with auto-networking helper enabled (default), which adds both public and private ip to the same eth0 interface.
In such a situation, rather than hard-coded selection of the first
nwResources[0].IP
entry, which is the public IP, Nomad should let us select private IP's resource for the purpose of fingerprint forunique.network.ip-address
from this interface.In other words, to fingerprint
unique.network.ip-address=$my_private_ip
in the above case, the client configuration should provide a way to choose which of the multiple available address resources from an interface should be used.Related code:
Apparently the behaviour has been recognized as, "Deprecated, setting the first IP as unique IP for the node", but is yet to be worked upon:
nomad/client/fingerprint/network.go
Lines 111 to 120 in 8372074
Reproduction steps
Linode's automatic Network Helper tool sets up something like this:
Current behaviour
Proposed behaviour
Workaround
The only workaround to this that I've been able to come up with is setting up a dummy interface on the system. And then setting:
It works but comes with its own oddities. See #3675 (comment).
Other considerations
client network_interface config doesn't parse sockaddr templates #3675 (comment)
The issue with the workaround missed on fixing the use case. It introduced sockaddr templating to network_interface config.
https://github.com/hashicorp/go-sockaddr
sockaddr templating does not help with this since network_interface only accepts interface names and not ip addresses or CIDRs.
Nomad does not honor interface names with a colon in the name (:) #19554
Apart from, say,
eth0
's resource label likeeth0:1
, network interface names themselves can also contain colons in them. Perhaps the fix could first look foreth0:1
interface, and then foreth0:1
labelled resource withineth0
interface, in that order.client.network_interface configuration is not respected when running in AWS or Azure #11069
This seems related but with insufficient troubleshooting by the original poster?
https://discuss.hashicorp.com/t/how-to-change-unique-network-ip-address-for-a-node/22696
The text was updated successfully, but these errors were encountered: