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

Add Sentinel Envoy RLS server implementation #1139

Merged
merged 2 commits into from Nov 6, 2019

Conversation

sczyh30
Copy link
Member

@sczyh30 sczyh30 commented Nov 5, 2019

Describe what this PR does / why we need it

Add the sentinel-cluster-server-envoy-rls module, a Envoy RLS server implementation using Sentinel token server. See #666 (comment) for initial design proposal.

Does this pull request fix one issue?

Resolves #666

Describe how you did it

  • EnvoyRlsRuleManager: loads EnvoyRlsRule, convert to Sentinel cluster flow rules and apply to ClusterFlowRuleManager (in default namespace).
  • EnvoySentinelRuleConverter: convert EnvoyRlsRule to cluster FlowRule and generate a consistent and unique flow ID.
  • SentinelEnvoyRlsServiceImpl: the RLS gRPC service implementation, which will delegate rule checking to SimpleClusterFlowChecker and assemble result for all descriptors.
  • EnvoyRlsRuleDataSourceService: for initializing the YAML file rule data source.
  • SentinelEnvoyRlsServer: the main entry of the RLS server.

Describe how to verify it

Run the test cases and demo.

Special notes for reviews

NONE

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
@sczyh30 sczyh30 added to-review To review kind/feature Category issues or prs related to feature request. labels Nov 5, 2019
@codecov-io
Copy link

Codecov Report

Merging #1139 into master will decrease coverage by 0.17%.
The diff coverage is 36.42%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1139      +/-   ##
============================================
- Coverage     42.93%   42.75%   -0.18%     
- Complexity     1503     1528      +25     
============================================
  Files           320      329       +9     
  Lines          9403     9683     +280     
  Branches       1283     1314      +31     
============================================
+ Hits           4037     4140     +103     
- Misses         4871     5035     +164     
- Partials        495      508      +13
Impacted Files Coverage Δ Complexity Δ
...erver/envoy/rls/flow/SimpleClusterFlowChecker.java 0% <0%> (ø) 0 <0> (?)
.../rls/datasource/EnvoyRlsRuleDataSourceService.java 0% <0%> (ø) 0 <0> (?)
...uster/server/envoy/rls/SentinelEnvoyRlsServer.java 0% <0%> (ø) 0 <0> (?)
...luster/server/envoy/rls/SentinelRlsGrpcServer.java 0% <0%> (ø) 0 <0> (?)
...ter/server/envoy/rls/rule/EnvoyRlsRuleManager.java 41.07% <41.07%> (ø) 4 <4> (?)
.../cluster/server/envoy/rls/log/RlsAccessLogger.java 45.45% <45.45%> (ø) 2 <2> (?)
.../server/envoy/rls/SentinelEnvoyRlsServiceImpl.java 51.78% <51.78%> (ø) 7 <7> (?)
...el/cluster/server/envoy/rls/rule/EnvoyRlsRule.java 57.5% <57.5%> (ø) 5 <5> (?)
...ver/envoy/rls/rule/EnvoySentinelRuleConverter.java 84.61% <84.61%> (ø) 6 <6> (?)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf5b955...bbe3a6c. Read the comment docs.

@sczyh30 sczyh30 added this to the 1.7.0 milestone Nov 6, 2019
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

lgtm

@sczyh30 sczyh30 merged commit b66680b into alibaba:master Nov 6, 2019
@sczyh30 sczyh30 removed the to-review To review label Nov 6, 2019
@sczyh30 sczyh30 deleted the feature/envoy-rls branch November 6, 2019 13:49
hughpearse pushed a commit to hughpearse/Sentinel that referenced this pull request Jun 2, 2021
* Add the sentinel-cluster-server-envoy-rls module, a Envoy RLS server implementation using Sentinel token server.

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Category issues or prs related to feature request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Envoy global rate limiting gRPC service with Sentinel cluster flow control
2 participants