-
Notifications
You must be signed in to change notification settings - Fork 273
lds: Add listener_filter_chain. #400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mattklein123
merged 16 commits into
envoyproxy:master
from
jrajahalme:listener-filter-chain
Jan 23, 2018
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
02b4a5e
lds: Add listener_filter_chain.
jrajahalme 74a163a
lds: Fix spacing.
jrajahalme 113052e
lds: Rename 'listener_filter_chain' to 'listener_filters'
jrajahalme 071ddd9
Merge branch 'master' into listener-filter-chain
jrajahalme 6f24f4d
lds: link to filter_chains in comment.
jrajahalme 0dd802c
lds: Rephrase the comment on 'listener_filters'
jrajahalme 2ce8e72
lds: Define ListenerFilter message type.
jrajahalme 138d110
Merge branch 'master' into listener-filter-chain
jrajahalme 94773bf
Merge branch 'master' into listener-filter-chain
jrajahalme fd02c81
docs: Add basic listener filter documentation.
jrajahalme 5f41ccc
Merge branch 'master' into listener-filter-chain
jrajahalme 11d9ab4
docs: Add listener_filters/listener_filters to toctree.
jrajahalme 362031f
docs: Add arch_overview/listener_filters.rst to the toctree.
jrajahalme a7e6fdf
docs: Remove proxy protocol listener filter from the docs.
jrajahalme d6f8842
docs: Review fixes.
jrajahalme e2a201a
lds: Deprecate 'use_original_dst' flag.
jrajahalme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
docs/root/configuration/listener_filters/listener_filters.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| .. _config_listener_filters: | ||
|
|
||
| Listener filters | ||
| ================ | ||
|
|
||
| Envoy has the follow builtin listener filters. | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 2 | ||
|
|
||
| original_dst_filter |
13 changes: 13 additions & 0 deletions
13
docs/root/configuration/listener_filters/original_dst_filter.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| .. _config_listener_filters_original_dst: | ||
|
|
||
| Original Destination | ||
| ==================== | ||
|
|
||
| Original destination listener filter reads the SO_ORIGINAL_DST socket option set when a connection | ||
| has been redirected by iptables REDIRECT. Later processing in Envoy sees the restored destination | ||
| address as the connection's local address, rather than the address at which the listener is | ||
| listening at. Furthermore, :ref:`an original destination cluster | ||
| <arch_overview_service_discovery_types_original_destination>` may be used to forward HTTP requests | ||
| or TCP connections to the restored destination address. | ||
|
|
||
| * :ref:`v2 API reference <envoy_api_field_Filter.name>` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| .. _arch_overview_listener_filters: | ||
|
|
||
| Listener filters | ||
| ================ | ||
|
|
||
| As discussed in the :ref:`listener <arch_overview_listeners>` section, listener filters may be | ||
| used to manipulate connection metadata. The main purpose of listener filters is to make adding | ||
| further system integration functions easier by not requiring changes to Envoy core functionality, | ||
| and also make interaction between multiple such features more explicit. | ||
|
|
||
| The API for listener filters is relatively simple since ultimately these filters operate on newly | ||
| accepted sockets. Filters in the chain can stop and subsequently continue iteration to | ||
| further filters. This allows for more complex scenarios such as calling a :ref:`rate limiting | ||
| service <arch_overview_rate_limit>`, etc. Envoy already includes several listener filters that | ||
| are documented in this architecture overview as well as the :ref:`configuration reference | ||
| <config_listener_filters>`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we deprecate the existing original_dst field? I think we should. This means:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One issue about this I have been thinking about is that doing a search for a forward-to listener is kind of expensive when there are many listeners, and likely not needed when v2 filter chain matching is implemented. I'd like to deprecate this search together with this flag, if possible. If not possible, I'd like to keep this flag and perform the search for another listener only if this flag is set. I.e., if original destination feature is configured as a listener filter, the search for another listener would not be done. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I guess if you don't want to deprecate until the full filter chain matching is implemented, that's fine, but I would put a TODO/comment somewhere. Or we can just mark up the deprecation now in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO marking for deprecation now is fine, anyone depending on this can still use v1 API regardless when filter chain matching is implemented. I'll mark this as TODO on the Envoy-side PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/envoyproxy/data-plane-api/blob/master/api/bootstrap.proto#L222
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I mean annotation per previous comment, then in the doc, then in DEPRECATED.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this would work as the doc annotation:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make it more clear that in the current code, handoff is not performed without this flag, and in the future when full filter chain matching is implemented it will be completely replaced with filter chain matching. Basically, it is partially deprecated. We can fully deprecate it when we do the full filter chain matching PR. Does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your comment above for additional clarity makes perfect sense, see the commit I'll post in a moment.