Hostname-dependent service in a service mesh


Im facing an issue with hostname-dependent service in our service mesh. Im using nomad to deploy a service ,A" within a service mesh (with sidecar proxy), which makes a connection to a service ,B" which is located outside the service mesh. To make that work I’ve registered service B as external service in consul, then I’ve deployed a terminating gateway with Nomad, which makes a connection to outside the service mesh. My service A has an env variable, where url of a service B is passed.

When we deploy service A with env B_URL = “localhost:port”, sidecar proxy will send all requests made from service A to a terminating gateway, which will send those to a service B. Answer from service B is successfully received.

Unfortunately, service A uses external library with a function, where variable B_URL is compared with received answer. Comparison of B_URL=localhost:port (sidecar proxy) with received answer of throws us an error.

fatal error: oidc: issuer did not match the issuer returned by provider, expected “” got “

Any advice would be really appreciated.

@Luke_b, the next release of Nomad will support Consul’s transparent proxy feature. This will allow the external application to be reached using its normal hostname instead of localhost:<port>.

See this blog post for more info on the transparent proxy feature.