Skip to content

Honor l5d-override-dst for inbound service profiles#267

Merged
hawkw merged 3 commits intomasterfrom
eliza/inbound-override-dst
Jun 8, 2019
Merged

Honor l5d-override-dst for inbound service profiles#267
hawkw merged 3 commits intomasterfrom
eliza/inbound-override-dst

Conversation

@hawkw
Copy link
Contributor

@hawkw hawkw commented Jun 7, 2019

When the proxy receives an inbound request, it strips the
l5d-dst-override header and ignores its value. Instead, this header
value should be honored in the inbound router as it is in the outbound
router. This will enable service profile discovery from ingresses, for
instance.

This branch changes the inbound router to use the l5d-override-dst
header preferentially, with only the l5d-canonical-dst header taking
priority over it if it is present. The layer that strips the override
header is moved to under the inbound dst router.

In addition, I've added new tests in the discovery module that assert
that the value of the l5d-override-dst header is used for profile
discovery when present, on both the inbound and outbound sides of the
proxy. The inbound tests fail prior to the other changes on this branch.

Closes linkerd/linkerd2#2910.

Signed-off-by: Eliza Weisman [email protected]

@hawkw hawkw added the enhancement New feature or request label Jun 7, 2019
@hawkw hawkw requested review from kleimkuhler and olix0r June 7, 2019 22:29
@hawkw hawkw self-assigned this Jun 7, 2019
debug!("inbound canonical={:?}", canonical);

let dst = canonical
.or_else(|| {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the one thing in this PR I wasn't completely sure about --- should l5d-override-dst take priority over l5d-canonical-dst, or the other way around?

In practice, I think we won't see both on the same inbound request, since l5d-canonical-dst is expected to only be set by outbound linkerd proxies, while l5d-override-dst is expected to be set only by clients that are not linkerd proxies (as the outbound proxy will strip that header after using it). So, the ordering may not actually matter all that much.

Copy link
Member

Choose a reason for hiding this comment

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

Good question. i think canonical-dst should take precedence, since it would only have been set by a calling proxy. If l5d-dst-override had also been set, they should in theory be identical (though the override could potentially be non-canonical? maybe?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@olix0r yup, that confirms what i was thinking! thanks.

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.

thanks for the tests! this looks good to me.

Signed-off-by: Eliza Weisman <[email protected]>
@hawkw hawkw merged commit db26495 into master Jun 8, 2019
@hawkw hawkw deleted the eliza/inbound-override-dst branch June 8, 2019 00:09
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Jun 13, 2019
    439fbfed Update to rust-1.35.0 (linkerd/linkerd2-proxy#265)
    db26495e Honor `l5d-override-dst` for inbound service profiles (linkerd/linkerd2-proxy#267)
    a476e995 metrics: Include the prefix of a Report in log lines (linkerd/linkerd2-proxy#262)
    1a52a5e6 discovery: Fall back in MakeService, only on InvalidArgument (linkerd/linkerd2-proxy#268)
    35df8ab4 metrics: Classify response errors  (linkerd/linkerd2-proxy#269)
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Jun 13, 2019
    439fbfed Update to rust-1.35.0 (linkerd/linkerd2-proxy#265)
    db26495e Honor `l5d-override-dst` for inbound service profiles (linkerd/linkerd2-proxy#267)
    a476e995 metrics: Include the prefix of a Report in log lines (linkerd/linkerd2-proxy#262)
    1a52a5e6 discovery: Fall back in MakeService, only on InvalidArgument (linkerd/linkerd2-proxy#268)
    35df8ab4 metrics: Classify response errors  (linkerd/linkerd2-proxy#269)
hawkw pushed a commit to linkerd/linkerd2 that referenced this pull request Jun 13, 2019
439fbfed Update to rust-1.35.0 (linkerd/linkerd2-proxy#265)
    db26495e Honor `l5d-override-dst` for inbound service profiles (linkerd/linkerd2-proxy#267)
    a476e995 metrics: Include the prefix of a Report in log lines (linkerd/linkerd2-proxy#262)
    1a52a5e6 discovery: Fall back in MakeService, only on InvalidArgument (linkerd/linkerd2-proxy#268)
    35df8ab4 metrics: Classify response errors  (linkerd/linkerd2-proxy#269)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

proxy: Honor l5d-dst-override for inbound service profiles

2 participants