Skip to content

move client policy discovery out of HTTP logical stack#2035

Merged
hawkw merged 6 commits intoeliza/client-policy-apifrom
eliza/discover-policies
Dec 6, 2022
Merged

move client policy discovery out of HTTP logical stack#2035
hawkw merged 6 commits intoeliza/client-policy-apifrom
eliza/discover-policies

Conversation

@hawkw
Copy link
Contributor

@hawkw hawkw commented Dec 2, 2022

This branch refactors the prototype client policy code to move the
discovery of client policies to still occur after profile discovery, but
before the HTTP logical stack. This means that SO_ORIGINAL_DST addresses
need not be stored in the Logical target type any longer, which I
think is significantly nicer, as we no longer have a Logical field
that's ignored by hashing and equality.

Instead, the client policy discovery now occurs in the stack produced by
push_discover. This is conceptually much more correct. In addition, it
allows us to remove the separate caching logic for client policy
lookups, and just use the same per-original-destination-address cache
that's used for service profile lookups. This simplifies the policy code
significantly, and allows moving stuff back out of
linkerd-app-outbound and into linkerd-client-policy, since the
policy receiver need no longer be wrapped in a Cached handle.

Depends on #2034

@hawkw hawkw requested a review from a team as a code owner December 2, 2022 20:31
@hawkw hawkw marked this pull request as draft December 2, 2022 20:31
Base automatically changed from eliza/route-splitting to eliza/client-policy-api December 6, 2022 17:35
@hawkw hawkw force-pushed the eliza/discover-policies branch from 042dda0 to d893b68 Compare December 6, 2022 17:41
hawkw added 6 commits December 6, 2022 10:28
This branch refactors the prototype client policy code to move the
discovery of client policies to still occur after profile discovery, but
before the HTTP logical stack. This means that SO_ORIGINAL_DST addresses
need not be stored in the `Logical` target type any longer, which I
think is significantly nicer, as we no longer have a `Logical` field
that's ignored by hashing and equality.

Instead, the client policy discovery now occurs in the `switch_logical`
stack. This is also not my _favorite_ for it, because now that stack is
responsible for more than just switching based on whether or not a
logical destination exists...but maybe the solution is just to rename
that stack.

However, with the current structure of the outbound proxy, if we want
`push_switch_logical` to push a stack that outptus a `Logical` target,
client policy discovery has to occur there, because we would want to
perform client policy lookups prior to constructing the `Logical` target
type, while we still have an `OrigDstAddr`. Alternatively, we could have
that stack output a different target type, and push a client policy
discovery stack that consumes that target type and constructs a
`Logical` target, but this felt like the simplest approach that didn't
require propagating the `OrigDstAddr` via the `Logical` target (like we
were doing previously).

Depends on #2029
This seems like the actual correct place...
@hawkw hawkw force-pushed the eliza/discover-policies branch from 8eeeb3d to 0e74440 Compare December 6, 2022 18:28
@hawkw hawkw marked this pull request as ready for review December 6, 2022 18:29
@hawkw hawkw merged commit 406e942 into eliza/client-policy-api Dec 6, 2022
@hawkw hawkw deleted the eliza/discover-policies branch December 6, 2022 18:31
hawkw added a commit that referenced this pull request Dec 6, 2022
This branch refactors the prototype client policy code to move the
discovery of client policies to still occur after profile discovery, but
before the HTTP logical stack. This means that SO_ORIGINAL_DST addresses
need not be stored in the `Logical` target type any longer, which I
think is significantly nicer, as we no longer have a `Logical` field
that's ignored by hashing and equality.

Instead, the client policy discovery now occurs in the stack produced by
`push_discover`. This is conceptually much more correct. In addition, it
allows us to remove the separate caching logic for client policy
lookups, and just use the same per-original-destination-address cache
that's used for service profile lookups. This simplifies the policy code
significantly, and allows moving stuff back out of
`linkerd-app-outbound` and into `linkerd-client-policy`, since the
policy receiver need no longer be wrapped in a `Cached` handle.

Depends on #2034
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.

1 participant