-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
router: scoped RDS (2/4): support scoped routing configuration #5839
Closed
AndresGuedez
wants to merge
28
commits into
envoyproxy:master
from
AndresGuedez:scoped-rds-inline-dynamic
Closed
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
cdae885
Support scoped routing configuration.
AndresGuedez db48450
Derive test class from TestBase.
AndresGuedez 756afcd
fix_format fixes.
AndresGuedez 8e624ea
Merge remote-tracking branch 'upstream/master' into scoped-rds-inline…
AndresGuedez 98149e5
Minor cleanup.
AndresGuedez 76b7196
Fix srds.proto docs.
AndresGuedez f924eb7
Pendatic spelling and docs cleanup.
AndresGuedez 51d8dff
fix_format.
AndresGuedez ccca775
More detailed documentation/examples for SRDS.
AndresGuedez e5d87db
fix_format.
AndresGuedez 9c3d45b
Update pedantic spelling dictionary.
AndresGuedez afcc2a5
Clarify Scope.Key documentation.
AndresGuedez c774f00
Use EXPECT_NO_THROW() to validate successful allocation/construction.
AndresGuedez 8cc1b13
fix_format.
AndresGuedez 71f2a74
Modify SRDS to support delta updates and ease transition to incremental.
AndresGuedez 5aed783
Support delta SRDS proto in integration test.
AndresGuedez 15b1c7c
Cleanup.
AndresGuedez b216034
Add comments.
AndresGuedez c8f531b
Merge remote-tracking branch 'upstream/master' into scoped-rds-inline…
AndresGuedez 39309ac
Fix build failures after master merge.
AndresGuedez 8fe33ad
Cleanup and comments.
AndresGuedez 8c38526
Fix format.
AndresGuedez dd2261c
Comments.
AndresGuedez a7a621b
Merge remote-tracking branch 'upstream/master' into scoped-rds-inline…
AndresGuedez 090bbd8
Cleanup and minor refactor of ConfigProvider framework.
AndresGuedez 8b8a5e7
clang-tidy cleanup.
AndresGuedez 43c95e8
More clang-tidy cleanup.
AndresGuedez 6adaa22
Fix build break.
AndresGuedez 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 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 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 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 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,135 @@ | ||
syntax = "proto3"; | ||
|
||
package envoy.api.v2; | ||
|
||
option java_outer_classname = "SrdsProto"; | ||
option java_package = "io.envoyproxy.envoy.api.v2"; | ||
option java_multiple_files = true; | ||
option java_generic_services = true; | ||
|
||
import "envoy/api/v2/discovery.proto"; | ||
|
||
import "google/api/annotations.proto"; | ||
|
||
import "validate/validate.proto"; | ||
import "gogoproto/gogo.proto"; | ||
|
||
option (gogoproto.equal_all) = true; | ||
|
||
// [#protodoc-title: HTTP scoped routing configuration] | ||
// * Routing :ref:`architecture overview <arch_overview_http_routing>` | ||
// | ||
// .. attention:: | ||
// | ||
// The Scoped RDS API is not yet fully implemented and *should not* be enabled in | ||
// :ref:`envoy_api_msg_config.filter.network.http_connection_manager.v2.HttpConnectionManager`. | ||
// | ||
// TODO(AndresGuedez): Update :ref:`arch_overview_http_routing` with scoped routing overview and | ||
// configuration details. | ||
|
||
// The Scoped Routes Discovery Service (SRDS) API distributes | ||
// :ref:`ScopedRouteConfiguration<envoy_api_msg.ScopedRouteConfiguration>` resources. Each | ||
// ScopedRouteConfiguration resource represents a "routing scope" containing a mapping that allows | ||
// the HTTP connection manager to dynamically assign a routing table (specified via | ||
// a :ref:`RouteConfiguration<envoy_api_msg_RouteConfiguration>` message) to each HTTP request. | ||
service ScopedRoutesDiscoveryService { | ||
rpc StreamScopedRoutes(stream DiscoveryRequest) returns (stream DiscoveryResponse) { | ||
} | ||
|
||
rpc DeltaScopedRoutes(stream DeltaDiscoveryRequest) returns (stream DeltaDiscoveryResponse) { | ||
} | ||
|
||
rpc FetchScopedRoutes(DiscoveryRequest) returns (DiscoveryResponse) { | ||
option (google.api.http) = { | ||
post: "/v2/discovery:scoped-routes" | ||
body: "*" | ||
}; | ||
} | ||
} | ||
|
||
// Specifies a routing scope, which associates a :ref:`envoy_api_msg_RouteConfiguration` (identified | ||
// by its resource name) to a :ref:`Key<envoy_api_msg_ScopedRouteConfiguration.Key>`. | ||
// | ||
// The HTTP connection manager builds up a table consisting of these Key to RouteConfiguration | ||
// mappings, and looks up the RouteConfiguration to use per request according to the algorithm | ||
// specified in the | ||
// :ref:`scope_key_builder<envoy_api_field_config.filter.network.http_connection_manager.v2.ScopedRoutes.scope_key_builder>` | ||
// assigned to the HttpConnectionManager. | ||
// | ||
// For example, with the following configurations (in YAML): | ||
// | ||
// HttpConnectionManager config: | ||
// | ||
// .. code:: | ||
// | ||
// ... | ||
// scope_key_builder: | ||
// fragments: | ||
// - header_element: | ||
// name: X-Route-Selector | ||
// element_separator: , | ||
// element: | ||
// separator: = | ||
// key: vip | ||
// | ||
// ScopedRouteConfiguration resources (specified statically via | ||
// HttpConnectionManager.ScopedRoutes.scoped_route_configurations_list or obtained dynamically via | ||
// SRDS): | ||
// | ||
// .. code:: | ||
// | ||
// (1) | ||
// name: route-scope1 | ||
// route_configuration_name: route-config1 | ||
// key: | ||
// fragments: | ||
// - string_key: 172.10.10.20 | ||
// | ||
// (2) | ||
// name: route-scope2 | ||
// route_configuration_name: route-config2 | ||
// key: | ||
// fragments: | ||
// - string_key: 172.20.20.30 | ||
// | ||
// A request from a client such as: | ||
// | ||
// .. code:: | ||
// | ||
// GET / HTTP/1.1 | ||
// Host: foo.com | ||
// X-Route-Selector: vip=172.10.10.20 | ||
// | ||
// Would result in the routing table defined by the `route-config1` RouteConfiguration being | ||
// assigned to the HTTP request/stream. | ||
// | ||
// [#comment:next free field: 4] | ||
message ScopedRouteConfiguration { | ||
// The name assigned to the routing scope. | ||
string name = 1 [(validate.rules).string.min_bytes = 1]; | ||
|
||
// Specifies a key which is matched against the output of the | ||
// :ref:`scope_key_builder<envoy_api_field_config.filter.network.http_connection_manager.v2.ScopedRoutes.scope_key_builder>` | ||
// specified in the HttpConnectionManager. The matching is done per HTTP request and is dependent | ||
// on the order of the fragments contained in the Key. | ||
message Key { | ||
message Fragment { | ||
oneof type { | ||
option (validate.required) = true; | ||
|
||
// A string to match against. | ||
string string_key = 1; | ||
} | ||
} | ||
|
||
// The ordered set of fragments to match against. | ||
repeated Fragment fragments = 1 [(validate.rules).repeated .min_items = 1]; | ||
} | ||
|
||
// The resource name to use for a :ref:`envoy_api_msg_DiscoveryRequest` to an RDS server to | ||
// fetch the :ref:`envoy_api_msg_RouteConfiguration` associated with this scope. | ||
string route_configuration_name = 2 [(validate.rules).string.min_bytes = 1]; | ||
|
||
// The key to match against. | ||
Key key = 3 [(validate.rules).message.required = true]; | ||
} |
This file contains 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 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 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 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 |
---|---|---|
|
@@ -6,4 +6,5 @@ HTTP route management | |
:maxdepth: 2 | ||
|
||
../api/v2/rds.proto | ||
../api/v2/srds.proto | ||
../api/v2/route/route.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.
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.
Thanks @AndresGuedez for this, my main thought looking at this is that the PR is too big to reasonably review and without diluting review bandwidth. Can we split the PR up further for review?
I think we should have this master PR kept open to show how things tie together, but then separate PRs for:
I think we can get better review velocity if we do it this way.
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.
Ack. Working on splitting this up.