Support Dynamic Upstream Port
- Dominant language
- Go
- Stars
- 17k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 105
Description
I believe that for connect upstreams, it really doesn't matter what port the connect proxy listens to to send the traffic over. Most use cases should use Nomad variable interpolation as part of a task's connection string, which totally makes the port definition irrelevant.
I believe users should be able to pick a port if they would like to, otherwise the default should be a dynamic port, just like how it is in the network stanza when defining a port for a task.
This saves the users from having to decide on a port that is, at the end, unnecessary.
Taking a snippet from the example in the docs:
```hcl
service {
name = "count-dashboard"
port = "9002"
connect {
sidecar_service {
proxy {
upstreams {
destination_name = "count-api"
# local_bind_port = 8080 #this port will be assigned by Nomad dynamically
}
}
}
}
}
task "dashboard" {
driver = "docker"
env {
# this will resolve to the proper address including the dynamic port
COUNTING_SERVICE_URL = "http://${NOMAD_UPSTREAM_ADDR_count_api}"
}
config {
image = "hashicorpnomad/counter-dashboard:v1"
}
}
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue names no source files, tests, or entry points. Start by locating Nomad's connect upstream handling and the existing local_bind_port behavior, then verify that an omitted port receives a dynamic assignment while an explicit port remains supported and the documented example reflects the result.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend, networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100