upstreams Stanza
Placement | job -> group -> service -> connect -> sidecar_service -> proxy -> upstreams |
The upstreams
stanza allows configuring various options for managing upstream
services that a Consul
Connect proxy routes to. It
is valid only within the context of a proxy
stanza.
For Consul-specific details see the Consul Connect Guide.
upstreams
Parameters
destination_name
(string: <required>)
- Name of the upstream service.local_bind_port
-(int: <required>)
- The port the proxy will receive connections for the upstream on.datacenter
(string: "")
- The Consul datacenter in which to issue the discovery query. Defaults to the empty string, which Consul interprets as the local Consul datacenter.
The NOMAD_UPSTREAM_ADDR_<destination_name>
environment variables may be used
to interpolate the upstream's host:port
address.
Applications are encouraged to connect to 127.0.0.1
and a well defined port
(eg 6379 for Redis) by default. Then when using Consul Connect the application
can be deployed with the Redis upstream's local_bind_port = 6379
and require
no explicit configuration.
upstreams
Examples
The following example is an upstream config with the name of the destination service and a local bind port.