hashicorp / hashicorp/consul

[question/feature] Termination gateway destination port.

Open
#10,120 0 comments 0 reactions 0 assignees View on GitHub
theme/connect theme/terminating-gw type/enhancement
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
1d 18h
Merged PRs (30d)
39

Description

#### Feature Description

Currently the Termination Gateway will proxy requests to a registered service's instance address as is in Consul.
We would like to be able to set a "DestinationPort" on the request instead of using the service's registered port.

#### Use Case(s)

We have a use case where we need to proxy the request to `{service-node-ip}:{custom-port}`, *not* to `{service-node-ip}:{service-port}`.
We have an existing service mesh (linkerd) running in a proxy per node setup. This allows us to begin migrating services over to Connect (different nodes) while maintaining mTLS and backwards compatibility.

#### Workaround

At the moment, the only way I have been able to achieve this is to create a custom Envoy build that modifies the ports returned by Consul's xDS. Not a solution I'm particularly happy with but will use if we have to.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the Termination Gateway request path and how Consul's xDS data supplies the registered service port. Determine where a request-level DestinationPort could be represented and how the proxy should use it instead of the registered port; done means requests reach the service node at the requested custom port without changing the existing default behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, infrastructure, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.