Skip to content

Add outbound proxy API#165

Merged
olix0r merged 29 commits intomainfrom
alex/outbound
Mar 7, 2023
Merged

Add outbound proxy API#165
olix0r merged 29 commits intomainfrom
alex/outbound

Conversation

@adleong
Copy link
Member

@adleong adleong commented Oct 13, 2022

Add the OutboundPolicy grpc service to the proxy API for serving outbound proxy policy. Similar to other proxy API services, it includes a Get method (used for debugging and manual inspection) and a Watch method, used to stream updates to the proxy.

Signed-off-by: Alex Leong alex@buoyant.io

Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Copy link
Contributor

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems reasonable to me so far!

Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
hawkw added a commit that referenced this pull request Oct 18, 2022
The ServiceProfile route-matching system is based on recursively nested
condition structures, while the HTTPRoute route-matching system is based
on a list of flat match rules. Therefore, we don't want to use the same
representation in the proxy to match both HTTPRoute- and
ServiceProfile-generated outbound Services, but we would like the same
API to be able to configure both.

This PR builds on #165 by allowing the `OutboundPolicies` RPC service to
return either ServiceProfile-based or HTTPRoute-based HTTP route
matching rules. The `HttpRoute` protobuf message now contains a `oneof`
that's either a list of HTTPRoute rules *or* a ServiceProfile match
condition. This way, the policy API server can tell the proxy about
policies configured by HTTPRoutes or by legacy ServiceProfiles.

The rest of the protobuf is unchanged, as the response classes,
retryability, and timeout fields are the same; only the route matching
condition varies. Currently, the set of arbitrary metrics labels is
included only when the route is configured by a ServiceProfile, because
we have yet to determine whether the new HTTPRoute-based client policy
design will include similar arbitrary sets of metrics labels. However,
this can be moved to the main message type if this is going to be
included in both cases.
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
hawkw added a commit that referenced this pull request Nov 9, 2022
PR #165 adds a proposal for the new `outbound` API for discovering
client-side HTTPRoute policy. However, this branch cannot currently be
used by the proxy, because the Rust crate for the proxy API bindings
doesn't actually include the generated code for the new `outbound`
proto.

This branch adds a module including the generated outbound API in the
Rust crate so that the new API can be used.
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
adleong and others added 7 commits December 12, 2022 23:38
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
Currently, the proxy's client policy module supports configuring queue
parameters (capacity and failfast timeout) and load balancer parameters
(the load estimate and peak EWMA parameters) on a per-backend basis.
However, the proxy API does not currently provide these configurations.

This branch adds new messages and fields describing these configurations
to the `outbound.Backend` message. I chose to nest all the new message
types inside of `Backend`, but we could also move them out of `Backend`
if we might want to use them elsewhere.
hawkw added a commit to linkerd/linkerd2-proxy that referenced this pull request Mar 3, 2023
This branch adds functions to the `linkerd-proxy-client-policy` crate
for converting the `linkerd2-proxy-api` outbound policy protobuf types
into the proxy's internal representations. These are not used in this
branch, but will be used in subsequent changes that actually wire up
outbound policy discovery.

This change was factored out from #2265, so that it can be reviewed
independently of the rest of the client policy discovery plumbing.

Note that this branch changes the `linkerd2-proxy-api` dependency to a
Git dep on the outbound policy branch (linkerd/linkerd2-proxy-api#165),
as the new APIs have not yet been published.
Copy link
Member

@olix0r olix0r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty close. I'll put up some suggestions shortly.

@adleong adleong marked this pull request as ready for review March 6, 2023 20:26
olix0r added a commit that referenced this pull request Mar 6, 2023
To understand whether the changes proposed in #165 will be suitable for
extension, this change adds a GrpcRoute type. This motivates a number of
followup changes, all of which make the API more closely mirror the
proxy's representation:

* Filter and Distribution moved into HttpRoute. Each protocol/variant
  may have its own filter types, so we want to preserve namespacing.
* Weights moved up into the Distribution
* HttpRoute and GrpcRoute each get a RouteBackend that holds
  protocol-specific filter kinds.
* Queue extracted from Backend. We could use it elsewhere...
* Extracted an `EndpointDiscovery` strategy from `BalanceP2c` so that we
  can change that API if desired.
* Added a `Metadata` onto the backend -- the controller is going to have
  populate that.
@olix0r olix0r mentioned this pull request Mar 6, 2023
olix0r added a commit that referenced this pull request Mar 6, 2023
To understand whether the changes proposed in #165 will be suitable for
extension, this change adds a GrpcRoute type. This motivates a number of
followup changes, all of which make the API more closely mirror the
proxy's representation:

* Filter and Distribution moved into HttpRoute. Each protocol/variant
  may have its own filter types, so we want to preserve namespacing.
* Weights moved up into the Distribution
* HttpRoute and GrpcRoute each get a RouteBackend that holds
  protocol-specific filter kinds.
* Queue extracted from Backend. We could use it elsewhere...
* Extracted an `EndpointDiscovery` strategy from `BalanceP2c` so that we
  can change that API if desired.
* Added a `Metadata` onto the backend -- the controller is going to have
  populate that.
olix0r added 4 commits March 6, 2023 16:08
To understand whether the changes proposed in #165 will be suitable for
extension, this change adds a GrpcRoute type. This motivates a number of
followup changes, all of which make the API more closely mirror the
proxy's representation:

* Filter and Distribution moved into HttpRoute. Each protocol/variant
  may have its own filter types, so we want to preserve namespacing.
* Weights moved up into the Distribution
* HttpRoute and GrpcRoute each get a RouteBackend that holds
  protocol-specific filter kinds.
* Queue extracted from Backend. We could use it elsewhere...
* Extracted an `EndpointDiscovery` strategy from `BalanceP2c` so that we
  can change that API if desired.
* Added a `Metadata` onto the backend -- the controller is going to have
  populate that.
The new API needs to be able to describe, generally, opaque routes, even
though there is no user-facing configuration for these routes at the
moment.

This change eliminates the `Backend` on the top level response--it was
used only to synthesize an opaque route in the proxy. This opaque
route should be represented properly in the API and synthesized in the
control plane.
@olix0r olix0r self-assigned this Mar 7, 2023
@olix0r olix0r enabled auto-merge (squash) March 7, 2023 00:46
@olix0r olix0r disabled auto-merge March 7, 2023 00:47
@olix0r olix0r merged commit 9efe50f into main Mar 7, 2023
@olix0r olix0r deleted the alex/outbound branch March 7, 2023 00:47
hawkw added a commit to linkerd/linkerd2-proxy that referenced this pull request Mar 8, 2023
This branch adds functions to the `linkerd-proxy-client-policy` crate
for converting the `linkerd2-proxy-api` outbound policy protobuf types
into the proxy's internal representations. These are not used in this
branch, but will be used in subsequent changes that actually wire up
outbound policy discovery.

This change was factored out from #2265, so that it can be reviewed
independently of the rest of the client policy discovery plumbing.

Note that this branch changes the `linkerd2-proxy-api` dependency to a
Git dep on the outbound policy branch (linkerd/linkerd2-proxy-api#165),
as the new APIs have not yet been published.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants