Stop honoring DESTINATION_GET_* configuration#696
Conversation
In a5e0b29, we extracted profile resolution so that each component (inbound/outbound/gateway) makes its own filtering decisions. This change does the same for endpoing resolution, moving the bulk of the logic out of `app:dst` and into `app::outbound::resolve`. The `app::dst` module is now only responsible for providing API clients that transparently retry/reconnect. Furthermore, the `...DESTINATION_GET_{SUFFIXES,NETWORKS}` environment variables are no longer honored. Now, endpoints are resolved for all addresses for which a profile lookup is successful. The `Resolve` API has been cleaned up slightly: we no longer rely on the `TryStream` alias (as it causes confusion + boilerplate), instead relying on the more general `Stream`.
|
Looks like some tests aren't compiling? |
hawkw
left a comment
There was a problem hiding this comment.
this looks good to me (i'm assuming that the change to not send schemes in Destination.Get requests is expected on the controller side). the refactoring all makes sense.
i wonder if we want to rename the PROFILE_GET_xxx env variables, since they now configure both profile and destination discovery? but, that would require changing the proxy injector etc as well, so we should probably punt on that for the immediate future.
| names: NameMatch, | ||
| nets: IpMatch, |
| map_endpoint::Resolve::new( | ||
| endpoint::FromMetadata, | ||
| RecoverDefault(RequestFilter::new(filter, resolve.into_service())), | ||
| ) |
There was a problem hiding this comment.
just a thought: it seems like, theoretically, we could compose a lot of the resolver stuff using a stack rather than a bunch of nested constructors...maybe a future refactor?
There was a problem hiding this comment.
I think stacks are preferable when we have to compose many orthogonal concerns. In this case, I think it's simpler/clearer to just construct the services manually.
Punt for now |
This release overhauls the discovery and routing logic implemented by the proxy: instead of looking at HTTP request metadata for service discovery, the outbound proxy now exclusively use each connection's target IP:PORT. This eager resolution eliminates per-request cache binding; and supports using TrafficSplit with non-HTTP services. This has a few side effects: - The `l5d-dst-override` header is no longer honored. - When the application attempts to connect to a pod IP, the proxy no longer load balances these requests among all pods in the service. The proxy will now honor session-stickiness as selected by an application-level load balancer. - `TrafficSplits` are only applied when a client targets a service's IP. - The proxy no longer performs DNS "canonicalization" to translate relative host header names to a fully-qualified form. --- * Unify RequestFilter and Admit middlewares (linkerd/linkerd2-proxy#692) * Only allow name-based profile discovery for inbound requests (linkerd/linkerd2-proxy#695) * outbound: initial tests for TCP mTLS (with fewer moving parts) (linkerd/linkerd2-proxy#693) * Stop honoring DESTINATION_GET_* configuration (linkerd/linkerd2-proxy#696) * stack: add SwitchReady service (linkerd/linkerd2-proxy#694) * telemetry: Remove trailing comma in build_info labels (linkerd/linkerd2-proxy#699) * Update Rust to 1.47.0 (linkerd/linkerd2-proxy#701)
This release overhauls the discovery and routing logic implemented by the proxy: instead of looking at HTTP request metadata for service discovery, the outbound proxy now exclusively use each connection's target IP:PORT. This eager resolution eliminates per-request cache binding; and supports using TrafficSplit with non-HTTP services. This has a few side effects: - The `l5d-dst-override` header is no longer honored. - When the application attempts to connect to a pod IP, the proxy no longer load balances these requests among all pods in the service. The proxy will now honor session-stickiness as selected by an application-level load balancer. - `TrafficSplits` are only applied when a client targets a service's IP. - The proxy no longer performs DNS "canonicalization" to translate relative host header names to a fully-qualified form. --- * Unify RequestFilter and Admit middlewares (linkerd/linkerd2-proxy#692) * Only allow name-based profile discovery for inbound requests (linkerd/linkerd2-proxy#695) * outbound: initial tests for TCP mTLS (with fewer moving parts) (linkerd/linkerd2-proxy#693) * Stop honoring DESTINATION_GET_* configuration (linkerd/linkerd2-proxy#696) * stack: add SwitchReady service (linkerd/linkerd2-proxy#694) * telemetry: Remove trailing comma in build_info labels (linkerd/linkerd2-proxy#699) * Update Rust to 1.47.0 (linkerd/linkerd2-proxy#701) * cache: Delete benchmarks (linkerd/linkerd2-proxy#705) * outbound: Discover profiles for each unique TCP target (linkerd/linkerd2-proxy#704)
In a5e0b29, we extracted profile resolution so that each component
(inbound/outbound/gateway) makes its own filtering decisions. This
change does the same for endpoing resolution, moving the bulk of the
logic out of
app:dstand intoapp::outbound::resolve.The
app::dstmodule is now only responsible for providing API clientsthat transparently retry/reconnect.
Furthermore, the
...DESTINATION_GET_{SUFFIXES,NETWORKS}environmentvariables are no longer honored. Now, endpoints are resolved for all
addresses for which a profile lookup is successful.
The
ResolveAPI has been cleaned up slightly: we no longer rely on theTryStreamalias (as it causes confusion + boilerplate), instead relyingon the more general
Stream.