RateLimit middleware
The RateLimit middleware helps manage the number of requests that services receive, ensuring fair usage according to specified limits.
This middleware applies to the entire route, eliminating the need to specify individual path fields.
Example of a rate limiting middleware
middlewares:
- name: rate-limit
type: rateLimit # or ratelimit
rule:
unit: minute # or hour
requestsPerUnit: 60 # Maximum number of requests per unit of time
Parameters:
unit
: The time period used for rate limiting. Can be set to eitherminute
orhour
.requestsPerUnit
: The maximum number of requests allowed per time unit
Advanced Kubernetes deployment
apiVersion: gomaproj.github.io/v1beta1
kind: Middleware
metadata:
name: ratelimit-middleware-sample
spec:
type: rateLimit
rule:
unit: minute # or hour
requestsPerUnit: 60