From 8019ae4cb85ceb42a8f41d94b2d01921cb5341e6 Mon Sep 17 00:00:00 2001 From: sh2 Date: Wed, 9 Aug 2023 15:16:51 +0800 Subject: [PATCH] follow-up(doc, fix): support for grpcroute ratelimitfilter (#1766) * bug fix: should not continue if grpcroute has no authenfilters Signed-off-by: sh2 * add doc for grpcroute ratelimitfilter Signed-off-by: sh2 * change doc to latest Signed-off-by: sh2 * update doc and fix comment Signed-off-by: sh2 --------- Signed-off-by: sh2 Co-authored-by: Xunzhuo --- docs/latest/user/rate-limit.md | 276 ++++++++++++++++++++- internal/provider/kubernetes/controller.go | 9 - internal/provider/kubernetes/filters.go | 9 + internal/provider/kubernetes/routes.go | 50 ++-- 4 files changed, 313 insertions(+), 31 deletions(-) diff --git a/docs/latest/user/rate-limit.md b/docs/latest/user/rate-limit.md index 9beebf65f4b..45e35b58e64 100644 --- a/docs/latest/user/rate-limit.md +++ b/docs/latest/user/rate-limit.md @@ -2,7 +2,7 @@ Rate limit is a feature that allows the user to limit the number of incoming requests to a predefined value based on attributes within the traffic flow. -Here are some reasons why you may want to implements Rate limits +Here are some reasons why you may want to implement Rate limits * To prevent malicious activity such as DDoS attacks. * To prevent applications and its resources (such as a database) from getting overloaded. @@ -13,13 +13,13 @@ i.e. if the data plane has 2 replicas of Envoy running, and the rate limit is 10 if 5 requests pass through the first replica and 5 requests pass through the second replica within the same second. Envoy Gateway introduces a new CRD called [RateLimitFilter][] that allows the user to describe their rate limit intent. This instantiated resource -can be linked to a [HTTPRoute][] resource using an [ExtensionRef][] filter. +can be linked to a [HTTPRoute][] or [GRPCRoute][] resource using an [ExtensionRef][] filter. ## Prerequisites ### Install Envoy Gateway -* Follow the steps from the [Quickstart Guide](quickstart.md) to install Envoy Gateway and the example manifest. +* Follow the steps from the [Quickstart Guide](quickstart.md) to install Envoy Gateway and the HTTPRoute example manifest. Before proceeding, you should be able to query the example backend using HTTP. ### Install Redis @@ -143,7 +143,13 @@ spec: limit: requests: 3 unit: Hour ---- +EOF +``` + +### HTTPRoute + +```shell +cat <