Skip to content
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

Support multi tenant route configuration selection based on HTTP attributes #4704

Closed
AndresGuedez opened this issue Oct 12, 2018 · 12 comments
Closed
Assignees
Labels
design proposal Needs design doc/proposal before implementation no stalebot Disables stalebot from closing an issue
Milestone

Comments

@AndresGuedez
Copy link
Contributor

Problem Statement

Envoy currently supports route configuration isolation in multi tenant environments by allowing a Listener FilterChain to specify a FilterChainMatch based on IP, TCP and TLS layer attributes.

When tenancy can be determined via these types of attributes, a FilterChain can be instantiated with a corresponding HttpConnectionManager RouteConfiguration proto (via static config or RDS) that corresponds to the tenant.

This issue tracks a design proposal to also support tenant differentiation via HTTP layer attributes, such that a single Listener -> HttpConnectionManager filter can be used to process requests for multiple tenants, each of which must be assigned its own RouteConfiguration.

Design Proposal

The design proposal extends Envoy with a Scoped Route Discovery Service API, which supports creating route configuration "scopes" indexed via a dynamically generated key extracted from HTTP layer attributes.

The proposed enhancement can be used to satisfy other use cases as well, such as #4690.

@htuch htuch added the design proposal Needs design doc/proposal before implementation label Oct 12, 2018
@htuch
Copy link
Member

htuch commented Oct 12, 2018

This has +1 from me and other Googlers, so looking for community input.

@mattklein123
Copy link
Member

+1. I had one question about SRDS vs. building directly into RDS, and it seems to me the real problem is incremental delivery. There was discussion in the doc about field deprecation for this approach which I didn't fully understand and might be clarified a bit.

@mattklein123 mattklein123 added this to the 1.9.0 milestone Oct 12, 2018
@AndresGuedez
Copy link
Contributor Author

@htuch @mattklein123 thanks for the reviews and feedback.

I responded to comments in the doc and made some adjustments based on the feedback. I have been tied up with other work, but will be starting with implementation work on this shortly.

@htuch
Copy link
Member

htuch commented Oct 22, 2018

LGTM, anyone else wants to weigh in before we move forward? CC @envoyproxy/maintainers

@stale
Copy link

stale bot commented Nov 21, 2018

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label Nov 21, 2018
@AndresGuedez
Copy link
Contributor Author

Implementation work is ongoing. I am working on tests for the first PR which I am targeting for next week, although US holidays and a higher priority task are likely to delay this until the week after.

@stale stale bot removed the stale stalebot believes this issue/PR has not been touched recently label Nov 22, 2018
AndresGuedez added a commit to AndresGuedez/envoy that referenced this issue Dec 6, 2018
This commit introduces a framework for implementing configuration providers by generalizing the
RouteConfigProvider{,Manager} which currently implement HttpConnectionManager routing configuration
and the RDS API.

This is the first deliverable (out of a planned 4 or 5 PRs) of the Scoped RDS implementation (envoyproxy#4704).

Signed-off-by: Andres Guedez <aguedez@google.com>
@alyssawilk alyssawilk modified the milestones: 1.9.0, 1.10.0 Dec 19, 2018
lizan pushed a commit that referenced this issue Jan 2, 2019
…er framework (#5243)

This PR introduces a framework for creating static, inline and dynamic (xDS) config providers.

The intent is to create a shared foundation that simplifies implementation of Envoy configuration, in particular xDS config handlers with shared ownership semantics such that the underlying subscription, config proto and config implementation (i.e., the resulting data structures and business logic) are shared across providers and Envoy worker threads.

This PR generalizes the RouteConfigProvider, RouteConfigProviderManager and associated *Impls currently used for implementing HTTP route configuration and the RDS API. Note that static route configuration and RDS are not being transitioned to the generalized framework as part of this PR (see note below for details).

NOTE: This is PR 1 (out of 4) to implement the scoped HTTP routing design introduced in #4704. The planned PR chain is as follows:
1. Introduce generalized config provider framework
2. Implement static and dynamic scoped routing configuration based on framework introduced in PR 1; the scoped routing business logic will _not_ be part of PR 2
3. Implement scoped routing business logic
4. Refactor RDS to use generalized config provider

*Risk Level*: Low (this code is not yet in use; it will be enabled in a follow up PR)
*Testing*: New tests added.
*Docs Changes*: N/A
*Release Notes*: N/A

Signed-off-by: Andres Guedez <aguedez@google.com>
@stale
Copy link

stale bot commented Jan 18, 2019

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label Jan 18, 2019
@htuch htuch added no stalebot Disables stalebot from closing an issue and removed stale stalebot believes this issue/PR has not been touched recently labels Jan 18, 2019
AndresGuedez added a commit to AndresGuedez/envoy that referenced this issue Feb 5, 2019
This commit introduces:
- Support for scoped routing configuration parsing.
- Inline and dynamic config providers using the ConfigProvider framework.
- Unit and integration testing scaffolding.

This is the second step in the PR chain for envoyproxy#4704.

Signed-off-by: Andres Guedez <aguedez@google.com>
fredlas pushed a commit to fredlas/envoy that referenced this issue Mar 5, 2019
…er framework (envoyproxy#5243)

This PR introduces a framework for creating static, inline and dynamic (xDS) config providers.

The intent is to create a shared foundation that simplifies implementation of Envoy configuration, in particular xDS config handlers with shared ownership semantics such that the underlying subscription, config proto and config implementation (i.e., the resulting data structures and business logic) are shared across providers and Envoy worker threads.

This PR generalizes the RouteConfigProvider, RouteConfigProviderManager and associated *Impls currently used for implementing HTTP route configuration and the RDS API. Note that static route configuration and RDS are not being transitioned to the generalized framework as part of this PR (see note below for details).

NOTE: This is PR 1 (out of 4) to implement the scoped HTTP routing design introduced in envoyproxy#4704. The planned PR chain is as follows:
1. Introduce generalized config provider framework
2. Implement static and dynamic scoped routing configuration based on framework introduced in PR 1; the scoped routing business logic will _not_ be part of PR 2
3. Implement scoped routing business logic
4. Refactor RDS to use generalized config provider

*Risk Level*: Low (this code is not yet in use; it will be enabled in a follow up PR)
*Testing*: New tests added.
*Docs Changes*: N/A
*Release Notes*: N/A

Signed-off-by: Andres Guedez <aguedez@google.com>
Signed-off-by: Fred Douglas <fredlas@google.com>
@mattklein123 mattklein123 modified the milestones: 1.10.0, 1.11.0 Mar 19, 2019
htuch pushed a commit that referenced this issue May 9, 2019
…rk (#6781)

Add support for "delta" APIs to the ConfigProvider framework in preparation for scoped RDS (see #4704).

A delta API receives a subset of the configuration set through each resource distributed via the *DiscoveryResponse messages.

While this PR is not directly related to the ongoing incremental xDS effort, it creates the foundation in the ConfigProvider framework to support Delta xDS updates for APIs implemented on top of the framework.

Risk Level: Low (there is no DS API yet using this framework)
Testing: Unit tests added, all existing tests passing.

Signed-off-by: Andres Guedez <aguedez@google.com>
htuch pushed a commit that referenced this issue May 22, 2019
Implement the scoped RDS (SRDS) API config subscription and provider based on the config protos introduced in #6675 and the ConfigProvider framework introduced in #5243 and #6781.

NOTES:

See parent PR #5839 for full context into these changes. PRs 2a (#6675) and 2b (#6781) have already been merged.
The API is not yet fully implemented. This PR introduces static and dynamic (xDS config subscription) handling of scoped routing configuration, but the new L7 multi tenant routing logic (see #4704) has not yet been introduced.
The API is not yet plumbed into the HttpConnectionManager, that will be done in the next PR.
This PR includes unit tests only; integration tests will follow in the next PR.

Risk Level: Low (this DS API is not yet integrated into the HCM and can not be enabled via config).
Testing: Unit tests added.
Docs Changes: N/A.

Signed-off-by: Andres Guedez <aguedez@google.com>
@mattklein123
Copy link
Member

@AndresGuedez is this issue done or is there further work to do?

@AndresGuedez
Copy link
Contributor Author

AndresGuedez commented Jul 3, 2019

@stevenzzzz is working on two more PRs for this. #7451 is out for review now.

@alyssawilk alyssawilk modified the milestones: 1.11.0, 1.12.0 Jul 8, 2019
@mattklein123 mattklein123 modified the milestones: 1.12.0, 1.13.0 Oct 10, 2019
@wbpcode
Copy link
Member

wbpcode commented Oct 18, 2019

Although this scheme can well classify route configurations based on HTTP attributes, I am a bit skeptical about whether it really works for multi-tenant scenarios. For example, if I have five hundred tenants, different tenants have only one plugin with different configurations, and all other configurations are the same. So based on this solution, I need to create five hundred scopes, copy all the configurations to five hundred copies, and only one plugin configuration is different in all copies. @mattklein123 @AndresGuedez

@htuch
Copy link
Member

htuch commented Oct 18, 2019

@wbpcode this is probably a distinct problem to what SRDS wants to solve. I think you're interested in deduplication of shared configuration across distinct RouteConfigurations. That's pretty interesting to think about. There are also alternatives, e.g. using lazy loading via SRDS when implemented, and only having the working set of configurations in memory, reducing the need to scale to very large numbers of configurations.

@mattklein123
Copy link
Member

I think this is done so closing this and we can track other improvements in new issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design proposal Needs design doc/proposal before implementation no stalebot Disables stalebot from closing an issue
Projects
None yet
Development

No branches or pull requests

5 participants