Open hichon78 opened 3 years ago
Thank you @Logik78.
I was able to reproduce it, and it does seem like we're dropping the sidecar service port information when going from the jobspec to the Consul API call.
Note, it also doesn't appear that the default configurations are obeyed either:
https://www.consul.io/docs/agent/options#sidecar_min_port
setting sidecar_min_port and sidecar_max_port doesn't do anything.
And also note that the defaults documented (21000 - 21255) are not obeyed, since I see port values of 27xxx and 28xxx
What is the actual default range of ports used for the sidecar proxies. I have an ingress proxy situated in a DMZ network zone that is connected to the mesh network and talks through the sidecars. I need to limit the firewall rules to a specific port range but this issue is currently blocking this.
Nomad version
Output from
nomad version
Nomad v1.1.2 (60638a086ef9630e2a9ba1e237e8426192a44244)
Operating system and Environment details
CentOS 7 Consul 1.8.5
Issue
I'm not sure whether this should be logged against nomad or consul. But the definition is in the Nomad job spec, so I'll start here. According to this doc, we should be able to override the consul sidecar proxy port via the service.connect.sidecar_service.port parameter.
https://www.consul.io/docs/connect/registration/sidecar-service#SidecarServiceDefaults
However, setting this doesn't seem to have any effect on the sidecar listening port. The port assignment is still dynamic and adheres to the default port range. I tried setting to a port outside of the default range as well as one within it. Both cases, the port was still dynamically assigned.
Reproduction steps
Create a service and sidecar proxy. I was using the dashboard demo for my testing:
Expected Result
The sidecar proxy should listen on the port provided in the configuration.
Actual Result
The sidecar proxy port was dynamically assigned and the configuration was ignored.
Job file (if appropriate)
Nomad Server logs (if appropriate)
N/A
Nomad Client logs (if appropriate)
N/A