Polish docs and samples of Envoy RLS token server module for RLS v3 API

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
This commit is contained in:
Eric Zhao 2022-01-04 10:54:38 +08:00
parent 02cfe40f8a
commit 356111f745
5 changed files with 17 additions and 20 deletions

View File

@ -3,6 +3,8 @@
This module provides the [Envoy rate limiting gRPC service](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/other_features/global_rate_limiting#arch-overview-rate-limit) implementation
with Sentinel token server.
The token server has supported both Envoy RLS v2 and v3 API. Since Envoy 1.18.0, v2 API support has been removed.
> Note: the gRPC stub classes for Envoy RLS service is generated via `protobuf-maven-plugin` during the `compile` goal.
> The generated classes is located in the directory: `target/generated-sources/protobuf`.
@ -19,7 +21,7 @@ mvn clean package -P prod
Sentinel RLS token server supports dynamic rule configuration via the yaml file.
The file may provide rules for one *domain* (defined in Envoy's conf file).
In Envoy, one rate limit request might carry multiple *rate limit descriptors*
(which will be generated from [Envoy rate limit actions](https://www.envoyproxy.io/docs/envoy/v1.12.1/api-v2/api/v2/route/route.proto#envoy-api-msg-route-ratelimit)).
(which will be generated from [Envoy rate limit actions](https://www.envoyproxy.io/docs/envoy/v1.20.1/api-v3/config/route/v3/route_components.proto#envoy-v3-api-msg-config-route-v3-ratelimit)).
One rate limit descriptor may have multiple entries (key-value pair).
We may set different threshold for each rate limit descriptors.

View File

@ -87,12 +87,6 @@ Then we could set rate limit rules for each target clusters.
After preparing the yaml template, you may deploy the Envoy instance:
```bash
kubectl apply -f sample/k8s/envoy.yml
```
for v3 api
```bash
kubectl apply -f sample/k8s/envoy-v3-api.yml
```

View File

@ -1,3 +1,4 @@
# NOTE: legacy V2 API sample, which has been deprecated
apiVersion: v1
kind: ConfigMap
metadata:
@ -82,7 +83,7 @@ data:
address: sentinel-rls-service
port_value: 10245
---
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: envoy-deployment-basic

View File

@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: envoy-cm-17
name: envoy-cm
data:
envoy-yml: |-
admin:
@ -94,22 +94,22 @@ data:
apiVersion: apps/v1
kind: Deployment
metadata:
name: envoy-deployment-basic-17
name: envoy-deployment-basic
labels:
app: envoy-17
app: envoy
spec:
replicas: 1
selector:
matchLabels:
app: envoy-17
app: envoy
template:
metadata:
labels:
app: envoy-17
app: envoy
spec:
containers:
- name: envoy
image: envoyproxy/envoy:v1.17.3
image: envoyproxy/envoy:v1.20.1
ports:
- containerPort: 10000
command: ["envoy"]
@ -120,7 +120,7 @@ spec:
volumes:
- name: envoy-config
configMap:
name: envoy-cm-17
name: envoy-cm
items:
- key: envoy-yml
path: envoy.yaml
@ -128,14 +128,14 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: envoy-service-17
name: envoy-service
labels:
name: envoy-service-17
name: envoy-service
spec:
type: NodePort
type: ClusterIP
ports:
- port: 10000
targetPort: 10000
protocol: TCP
selector:
app: envoy-17
app: envoy

View File

@ -11,7 +11,7 @@ data:
value: "service_httpbin"
count: 1
---
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: sentinel-rls-server