multicluster: Use the proxy as an HTTP gateway#4528
Conversation
The proxy can now operate as gateway, routing requests from its inbound proxy to the outbound proxy, without passing the requests to a local application. This supports Linkerd's multicluster feature by adding a `Forwarded` header to propagate the original client identity and assist in loop detection. --- * Add loop detection to inbound & TCP forwarding (linkerd/linkerd2-proxy#527) * Test loop detection (linkerd/linkerd2-proxy#532) * fallback: Unwrap errors recursively (linkerd/linkerd2-proxy#534) * app: Split inbound/outbound constructors into components (linkerd/linkerd2-proxy#533) * Introduce a gateway between inbound and outbound (linkerd/linkerd2-proxy#540) * gateway: Add a Forwarded header (linkerd/linkerd2-proxy#544) * gateway: Return errors instead of responses (linkerd/linkerd2-proxy#547) * Fail requests that loop through the gateway (linkerd/linkerd2-proxy#545)
This change introduces a new annotation, config.linkerd.io/enable-gateway, that, when set, enables the proxy to act as a gateway, routing all traffic targetting the inbound listener through the outbound proxy. This also removes the nginx default listener and gateway port of 4180, instead using 4143 (the inbound port).
|
I verified that works with the k3d script |
|
Note that the merge brought the |
|
For anyone who wants to test this, I have verified it works with this branch olix0r/l2-k3d-multi#2 |
| - name: LINKERD2_PROXY_INBOUND_LISTEN_ADDR | ||
| value: 0.0.0.0:{{.Values.global.proxy.ports.inbound}} | ||
| {{ if .Values.global.proxy.isGateway -}} | ||
| - name: LINKERD2_PROXY_INBOUND_GATEWAY_SUFFIXES |
There was a problem hiding this comment.
What are the semantics of this variable? When set, any requests to the inbound listener that match this suffix will be routed directly to the outbound proxy?
There was a problem hiding this comment.
Correct. (After DNS resolution)
|
For some reason I can't get this to work with the l2-k3d-multi setup... |
This change modifies the inbound gateway caching so that requests may be routed to multiple leaves of a traffic split. --- * inbound: Do not cache gateway services (linkerd/linkerd2-proxy#549)
|
OK. I've tested this with https://github.com/olix0r/l2-k3d-multi and it works as I'd expect with regard to loop detection and traffic split updating. |
This change introduces a new annotation,
config.linkerd.io/enable-gateway, that, when set, enables the proxy to
act as a gateway, routing all traffic targetting the inbound listener
through the outbound proxy.
This also removes the nginx default listener and gateway port of 4180,
instead using 4143 (the inbound port).
This includes an update to the proxy version v2.99.0.
The proxy can now operate as gateway, routing requests from its inbound
proxy to the outbound proxy, without passing the requests to a local
application. This supports Linkerd's multicluster feature by adding a
Forwardedheader to propagate the original client identity and assistin loop detection.