-
Notifications
You must be signed in to change notification settings - Fork 5.3k
udp: add router for UDP proxy #18791
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
Merged
Changes from all commits
Commits
Show all changes
93 commits
Select commit
Hold shift + click to select a range
4cfa9c5
udp: add route proto
zhxie 9891c45
udp: add router
zhxie 367db00
udp: route data to clusters
zhxie 3bd3085
udp: fix format
zhxie 4c1b126
udp: minor type change
zhxie 3f762f7
udp: clean code
zhxie 95e1094
test: add test for routing in UDP proxy
zhxie b592612
test: add test for route matching of UDP proxy
zhxie 804aedd
test: fix format
zhxie 37def08
udp: deprecate api in favor of router
zhxie 77fb547
test: prioritize router
zhxie 9c71fe4
docs: prioritize router
zhxie b4cbd8d
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie 4a201e7
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie b5086f2
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie 42ce9c3
router: add network data inputs
zhxie 0b14da0
udp: migrate to generic matching API
zhxie 744d74b
router: change cidr data input to IP and port
zhxie cf61bb7
udp: fix no cluster initialized when using generic matching
zhxie cc24008
example: update UDP proxy example
zhxie f5fd481
docs: update to generic matching
zhxie f613a87
docs: fix orphan proto
zhxie 4a2f3f8
test: update to generic matching
zhxie 115b532
test: remove redundant code
zhxie db04638
udp: fix bug using variable out of scope
zhxie e9f56d7
router: update network matching data structure
zhxie 786386b
test: add router coverage
zhxie f615fd5
test: add test for network data inputs
zhxie 854176a
test: fix spelling
zhxie 7cff9bf
test: fix format
zhxie b0fb7d6
udp: change router method name
zhxie 8cfdf65
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie cfee9b0
udp: remove generated api shadow
zhxie 063cf40
router: remove unused data inputs
zhxie 35b0f5e
udp: fix not throw on invalid data inputs
zhxie 7303e6f
udp: add docs for method
zhxie 8184199
test: mark some tests as deprecated feature test
zhxie 8f3e8e0
udp: revert deprecating cluster syntax
zhxie ecddff7
test: lower coverage for untested simple method in matching data
zhxie fae4e72
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie 69376a9
docs: add release notes
zhxie 0fc55bf
ci: kick CI
zhxie e779a36
udp: use full path for include
zhxie fb2731e
udp: update router abstraction
zhxie 68dc8fb
udp: deprecate cluster API again
zhxie 8de2770
ci: kick CI
zhxie e9cf799
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie 03005e5
udp: fix filter
zhxie e162cae
tests: prioritize router
zhxie d62539e
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie e49181a
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie b04a059
api: fix format
zhxie 87d1361
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie bd7b917
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie b00cf9e
nit: add comments and rename methods
zhxie 45165c6
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie 5173760
docs: update release notes
zhxie 0e19161
nit: change parameter names
zhxie 8b30f25
docs: update examples
zhxie d3db96e
examples: update examples
zhxie b501e34
tests: use single on_no_match
zhxie bc33bd0
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie 2b9fe8d
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie 9d1abd2
docs: fix release notes
zhxie 628855d
api: remove duplicate matching data from merging
zhxie cb3d52c
api: remove duplicate matching data from merging
zhxie d6911cc
udp: comply with network inputs
zhxie 29e86f8
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie 4478d77
udp: replace with network inputs
zhxie c1dc8b1
test: add UDP router test
zhxie 086ea89
nit: add comment for cluster infos
zhxie cf77be6
nit: explicitize variable route
zhxie 4830ec7
udp: route with different network inputs
zhxie 5ff8de5
docs: add docs for UDP proxy router
zhxie 43a1b80
docs: fix matcher example
zhxie 2be0b73
docs: fix matcher example
zhxie 03b55aa
udp: remove unused guard
zhxie 549a487
docs: emphasize matcher only
zhxie a08f1e1
api: clarify deprecation and usage
zhxie d368ef3
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie 9b46d46
mis: post merge conflict
zhxie 79d1748
docs: fix missing label
zhxie f959f11
docs: add deprecation notes
zhxie b9ac01e
nit: typo
zhxie 96d1ca1
udp: ensure matching
zhxie f0eead0
udp: fix cluster removal log
zhxie a5fc56d
udp: change specifier in route
zhxie 00a84ef
udp: merge path of cluster and matcher
zhxie eede13d
nit: fix typo
zhxie 0617a91
udp: update signature of route
zhxie 4eeea14
test: fix route
zhxie dc59d27
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie 3f9c62c
Merge remote-tracking branch 'envoyproxy/main' into udp-proxy-router
zhxie 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package envoy.extensions.filters.udp.udp_proxy.v3; | ||
|
|
||
| import "udpa/annotations/status.proto"; | ||
| import "validate/validate.proto"; | ||
|
|
||
| option java_package = "io.envoyproxy.envoy.extensions.filters.udp.udp_proxy.v3"; | ||
| option java_outer_classname = "RouteProto"; | ||
| option java_multiple_files = true; | ||
| option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/udp/udp_proxy/v3;udp_proxyv3"; | ||
| option (udpa.annotations.file_status).package_version_status = ACTIVE; | ||
|
|
||
| // [#protodoc-title: UDP proxy route configuration] | ||
| // UDP proxy :ref:`configuration overview <config_udp_listener_filters_udp_proxy>`. | ||
|
|
||
| message Route { | ||
| // Indicates the upstream cluster to which the request should be routed. | ||
| string cluster = 1 [(validate.rules).string = {min_len: 1}]; | ||
| } |
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
90 changes: 90 additions & 0 deletions
90
docs/root/configuration/listeners/udp_filters/_include/udp-proxy-router.yaml
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,90 @@ | ||
| static_resources: | ||
| listeners: | ||
| - name: listener_0 | ||
| address: | ||
| socket_address: | ||
| protocol: UDP | ||
| address: 0.0.0.0 | ||
| port_value: 1234 | ||
| listener_filters: | ||
| - name: envoy.filters.udp_listener.udp_proxy | ||
| typed_config: | ||
| '@type': type.googleapis.com/envoy.extensions.filters.udp.udp_proxy.v3.UdpProxyConfig | ||
| stat_prefix: service | ||
| matcher: | ||
| # The outer matcher list matches source IP. | ||
| matcher_list: | ||
| matchers: | ||
| - predicate: | ||
| single_predicate: | ||
| input: | ||
| name: envoy.matching.inputs.source_ip | ||
| typed_config: | ||
| '@type': type.googleapis.com/envoy.extensions.matching.common_inputs.network.v3.SourceIPInput | ||
| value_match: | ||
| exact: 127.0.0.1 | ||
| on_match: | ||
| matcher: | ||
| # The inner matcher tree matches source port. | ||
| matcher_tree: | ||
| input: | ||
| name: envoy.matching.inputs.source_port | ||
| typed_config: | ||
| '@type': type.googleapis.com/envoy.extensions.matching.common_inputs.network.v3.SourcePortInput | ||
| exact_match_map: | ||
| map: | ||
| "80": | ||
| action: | ||
| name: route | ||
| typed_config: | ||
| '@type': type.googleapis.com/envoy.extensions.filters.udp.udp_proxy.v3.Route | ||
| cluster: udp_service | ||
| "443": | ||
| action: | ||
| name: route | ||
| typed_config: | ||
| '@type': type.googleapis.com/envoy.extensions.filters.udp.udp_proxy.v3.Route | ||
| cluster: udp_service2 | ||
| on_no_match: | ||
| action: | ||
| name: route | ||
| typed_config: | ||
| '@type': type.googleapis.com/envoy.extensions.filters.udp.udp_proxy.v3.Route | ||
| cluster: udp_service3 | ||
| clusters: | ||
| - name: service_udp | ||
| type: STATIC | ||
| lb_policy: ROUND_ROBIN | ||
| load_assignment: | ||
| cluster_name: service_udp | ||
| endpoints: | ||
| - lb_endpoints: | ||
| - endpoint: | ||
| address: | ||
| socket_address: | ||
| address: 127.0.0.1 | ||
| port_value: 1235 | ||
| - name: service_udp2 | ||
| type: STATIC | ||
| lb_policy: ROUND_ROBIN | ||
| load_assignment: | ||
| cluster_name: service_udp | ||
| endpoints: | ||
| - lb_endpoints: | ||
| - endpoint: | ||
| address: | ||
| socket_address: | ||
| address: 127.0.0.1 | ||
| port_value: 1236 | ||
| - name: service_udp3 | ||
| type: STATIC | ||
| lb_policy: ROUND_ROBIN | ||
| load_assignment: | ||
| cluster_name: service_udp | ||
| endpoints: | ||
| - lb_endpoints: | ||
| - endpoint: | ||
| address: | ||
| socket_address: | ||
| address: 127.0.0.1 | ||
| port_value: 1237 |
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 |
|---|---|---|
|
|
@@ -146,6 +146,7 @@ New Features | |
| useful in support systems such as CI, CD, etc. The | ||
| :ref:`schema validator check tool <install_tools_schema_validator_check_tool>` has been added | ||
| to the tools image. | ||
| * udp_proxy: added :ref:`matcher <envoy_v3_api_field_extensions.filters.udp.udp_proxy.v3.UdpProxyConfig.matcher>` to support matching and routing to different clusters. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a note in deprecated below for the deprecated field.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, added. |
||
| * udp_proxy: added support for :ref:`access_log <envoy_v3_api_field_extensions.filters.udp.udp_proxy.v3.UdpProxyConfig.access_log>`. | ||
|
|
||
| Deprecated | ||
|
|
@@ -157,3 +158,4 @@ Deprecated | |
| * http: removing support for long-deprecated old style filter names, e.g. envoy.router, envoy.lua. | ||
| * re2: removed undocumented histograms ``re2.program_size`` and ``re2.exceeded_warn_level``. | ||
| * thrift: deprecated TTwitter protocol since we believe it's not used and it's causing significant maintenance burden. | ||
| * udp_proxy: deprecated :ref:`cluster <envoy_v3_api_field_extensions.filters.udp.udp_proxy.v3.UdpProxyConfig.cluster>` in favor of :ref:`matcher <envoy_v3_api_field_extensions.filters.udp.udp_proxy.v3.UdpProxyConfig.matcher>`. | ||
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
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,29 @@ | ||
| load( | ||
| "//bazel:envoy_build_system.bzl", | ||
| "envoy_cc_library", | ||
| "envoy_extension_package", | ||
| ) | ||
|
|
||
| licenses(["notice"]) # Apache 2 | ||
|
|
||
| envoy_extension_package() | ||
|
|
||
| envoy_cc_library( | ||
| name = "router_interface", | ||
| hdrs = ["router.h"], | ||
| ) | ||
|
|
||
| envoy_cc_library( | ||
| name = "router_lib", | ||
| srcs = ["router_impl.cc"], | ||
| hdrs = ["router_impl.h"], | ||
| deps = [ | ||
| ":router_interface", | ||
| "//source/common/common:empty_string", | ||
| "//source/common/matcher:matcher_lib", | ||
| "//source/common/matcher:validation_visitor_lib", | ||
| "//source/common/network/matching:data_impl_lib", | ||
| "//source/common/network/matching:inputs_lib", | ||
| "@envoy_api//envoy/extensions/filters/udp/udp_proxy/v3:pkg_cc_proto", | ||
| ], | ||
| ) |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.