-
Notifications
You must be signed in to change notification settings - Fork 405
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
Rate limiting #17572
Comments
With envoy filter configuration below, I was able to apply a rate limiting rule based on tenant specific url, to istio-ingress gateway. Scenario DescriptionEach tenant has specific url to access the multitenant application, see the example below: Token Bucket Algorithm Details:
Which means; sample tenant might send 10 ( request / minute ) * number of istio-gateway pod instance. Relevant Envoy Filter ConfigurationapiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: filter-local-ratelimit-ping-pong
namespace: susaas
spec:
workloadSelector:
labels:
istio: ingressgateway
configPatches:
- applyTo: HTTP_FILTER
match:
context: GATEWAY
listener:
filterChain:
filter:
name: "envoy.filters.network.http_connection_manager"
patch:
operation: INSERT_BEFORE
value:
name: envoy.filters.http.local_ratelimit
typed_config:
"@type": type.googleapis.com/udpa.type.v1.TypedStruct
type_url: type.googleapis.com/envoy.extensions.filters.http.local_ratelimit.v3.LocalRateLimit
value:
stat_prefix: http_local_rate_limiter
- applyTo: VIRTUAL_HOST
match:
context: GATEWAY
routeConfiguration:
vhost:
name: "tenant1.application.com:443"
route:
action: ANY
patch:
operation: MERGE
value:
typed_per_filter_config:
envoy.filters.http.local_ratelimit:
"@type": type.googleapis.com/udpa.type.v1.TypedStruct
type_url: type.googleapis.com/envoy.extensions.filters.http.local_ratelimit.v3.LocalRateLimit
value:
stat_prefix: http_local_rate_limiter
token_bucket:
max_tokens: 10
tokens_per_fill: 10
fill_interval: 60s
filter_enabled:
runtime_key: local_rate_limit_enabled
default_value:
numerator: 100
denominator: HUNDRED
filter_enforced:
runtime_key: local_rate_limit_enforced
default_value:
numerator: 100
denominator: HUNDRED
response_headers_to_add:
- append: false
header:
key: x-local-rate-limit
value: 'true' ResultWith this envoy filter, I was able to apply a primitive rate limiting configuration on istio gateway context. |
This issue or PR has been automatically marked as stale due to the lack of recent activity. This bot triages issues and PRs according to the following rules:
You can:
If you think that I work incorrectly, kindly raise an issue with the problem. /lifecycle stale |
This issue or PR has been automatically closed due to the lack of activity. This bot triages issues and PRs according to the following rules:
You can:
If you think that I work incorrectly, kindly raise an issue with the problem. /close |
@kyma-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This issue or PR has been automatically marked as stale due to the lack of recent activity. This bot triages issues and PRs according to the following rules:
You can:
If you think that I work incorrectly, kindly raise an issue with the problem. /lifecycle stale |
This issue or PR has been automatically closed due to the lack of activity. This bot triages issues and PRs according to the following rules:
You can:
If you think that I work incorrectly, kindly raise an issue with the problem. /close |
@kyma-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This issue has been automatically marked as stale due to the lack of recent activity. It will soon be closed if no further activity occurs. |
I did some time ago a tutorial: https://killercoda.com/interactive-kyma/scenario/rate-limit |
closing in favour of kyma-project/api-gateway#1365 |
Description
Provide a simple way to enable rate-limiting using EnvoyFilters. Consider extending APIRule or introducing a new custom resource.
Reasons
Envoy supports two kinds of rate limiting: global and local. Global rate limiting uses a global gRPC rate limiting service to provide rate limiting for the entire mesh. Local rate limiting is used to limit the rate of requests per service instance. Local rate limiting can be used in conjunction with global rate limiting to reduce the load on the global rate limiting service.
This task description from istio documentation contains example envoy filter configurations to enable rate limiting. It can be useful for more advanced users but can be overwhelming for beginners.
Scope
The minimum scope is a local rate limit. Global rate limit requires a central shared rate limit service to ensure that regardless of the number of instances the global rate limit is not exceeded. Generic rate limit service is provided by the Envoy project, it uses Redis as a storage.
The text was updated successfully, but these errors were encountered: