Advertise custom IP and port for Consul Connect
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 39
Description
I'm using Consul Connect with Docker so the consul proxy binds to a given IP address and port, let say `172.0.0.10` and `8000` and is available from the outside on the node IP address (`10.0.2.8`) and the bound port (`33769` for example).
It seems that this case is not handled by Consul connect and that there is currently no way to register another IP address and port than those the proxy is listening to.
It seems to me that the `-register` flag could accept an optional argument to advertise a different address. If this was possible, I could then launch the proxy using:
`consul connect proxy -service teapot -service-addr=127.0.0.1:8080 -listen=':8000' -http-addr=http://consul.service.consul:8500 -token=$CONSUL_CONNECT_TOKEN -register 10.0.2.8:33769`
Am I not using Consul Connect correctly or is this a missing functionality?
It seems to me that this could easily be done by making a small modification to https://github.com/hashicorp/consul/blob/c9217c9/command/connect/proxy/proxy.go#L330-L349.
Contributor guide
Research direction
Start in command/connect/proxy/proxy.go at the cited lines and trace how the -register option currently determines the advertised address and port. Review the proxy command's argument handling and registration flow; done means users can provide a separate advertised IP and port while the proxy continues listening on its configured address.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- distributed-systems, networking
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100