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
When using the alloc network mode in a service stanza, Nomad will register the service with the allocation's IP address and the port of the given label. However, it is often the case when using this feature that the to value of the referenced port is desired to be used. You can override the service port field with a numeric value, but this will also change the port any defined checks use.
Take the following example of a legacy service which identifies itself by its IP address and a layer 3 network configured by CNI. The service requires each instance to have a unique IP address. Rather than use a distinct_host constraint you'd like to configure each allocation with a seperate IP (out of scope of the issue).
group {
network {
mode="cni/mynet"port"listener" {
to=9999
}
service {
name="legacy"port="listener"addr_mode="alloc"check {
type="tcp"
}
}
}
In this example you'd like the service to be registered in consul with allocIP:9999, the address and port the application is bound on. Currently the actual result is a registration with the dynamic port. The check comes from the client and may not be able to route to the allocation address. Therefore the check doesn't inherit the addr_mode from the service and will use the host addr_mode which uses hostIP:dynamicPort as the check target which is port mapped to the alloc's address.
The proposal is to change the registration for alloc addr_mode to use the to value of the port label and fall back to the dynamic/static value if not set.
The text was updated successfully, but these errors were encountered:
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.
When using the
alloc
network mode in a service stanza, Nomad will register the service with the allocation's IP address and the port of the given label. However, it is often the case when using this feature that theto
value of the referenced port is desired to be used. You can override the serviceport
field with a numeric value, but this will also change the port any defined checks use.Take the following example of a legacy service which identifies itself by its IP address and a layer 3 network configured by CNI. The service requires each instance to have a unique IP address. Rather than use a distinct_host constraint you'd like to configure each allocation with a seperate IP (out of scope of the issue).
In this example you'd like the service to be registered in consul with
allocIP:9999
, the address and port the application is bound on. Currently the actual result is a registration with the dynamic port. The check comes from the client and may not be able to route to the allocation address. Therefore the check doesn't inherit the addr_mode from the service and will use thehost
addr_mode which uses hostIP:dynamicPort as the check target which is port mapped to the alloc's address.The proposal is to change the registration for alloc addr_mode to use the
to
value of the port label and fall back to the dynamic/static value if not set.The text was updated successfully, but these errors were encountered: