Update the documentation for RateLimit to provide a better example
This commit is contained in:
parent
676de5fb68
commit
8f29398573
1 changed files with 12 additions and 12 deletions
|
@ -16,15 +16,15 @@ It is based on a [token bucket](https://en.wikipedia.org/wiki/Token_bucket) impl
|
||||||
|
|
||||||
```yaml tab="Docker"
|
```yaml tab="Docker"
|
||||||
# Here, an average of 100 requests per second is allowed.
|
# Here, an average of 100 requests per second is allowed.
|
||||||
# In addition, a burst of 50 requests is allowed.
|
# In addition, a burst of 200 requests is allowed.
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.average=100"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.average=100"
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.burst=50"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.burst=200"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Kubernetes"
|
```yaml tab="Kubernetes"
|
||||||
# Here, an average of 100 requests per second is allowed.
|
# Here, an average of 100 requests per second is allowed.
|
||||||
# In addition, a burst of 50 requests is allowed.
|
# In addition, a burst of 200 requests is allowed.
|
||||||
apiVersion: traefik.io/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -32,12 +32,12 @@ metadata:
|
||||||
spec:
|
spec:
|
||||||
rateLimit:
|
rateLimit:
|
||||||
average: 100
|
average: 100
|
||||||
burst: 50
|
burst: 200
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Consul Catalog"
|
```yaml tab="Consul Catalog"
|
||||||
# Here, an average of 100 requests per second is allowed.
|
# Here, an average of 100 requests per second is allowed.
|
||||||
# In addition, a burst of 50 requests is allowed.
|
# In addition, a burst of 200 requests is allowed.
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.average=100"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.average=100"
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.burst=50"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.burst=50"
|
||||||
```
|
```
|
||||||
|
@ -45,36 +45,36 @@ spec:
|
||||||
```json tab="Marathon"
|
```json tab="Marathon"
|
||||||
"labels": {
|
"labels": {
|
||||||
"traefik.http.middlewares.test-ratelimit.ratelimit.average": "100",
|
"traefik.http.middlewares.test-ratelimit.ratelimit.average": "100",
|
||||||
"traefik.http.middlewares.test-ratelimit.ratelimit.burst": "50"
|
"traefik.http.middlewares.test-ratelimit.ratelimit.burst": "200"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="Rancher"
|
```yaml tab="Rancher"
|
||||||
# Here, an average of 100 requests per second is allowed.
|
# Here, an average of 100 requests per second is allowed.
|
||||||
# In addition, a burst of 50 requests is allowed.
|
# In addition, a burst of 200 requests is allowed.
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.average=100"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.average=100"
|
||||||
- "traefik.http.middlewares.test-ratelimit.ratelimit.burst=50"
|
- "traefik.http.middlewares.test-ratelimit.ratelimit.burst=200"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml tab="File (YAML)"
|
```yaml tab="File (YAML)"
|
||||||
# Here, an average of 100 requests per second is allowed.
|
# Here, an average of 100 requests per second is allowed.
|
||||||
# In addition, a burst of 50 requests is allowed.
|
# In addition, a burst of 200 requests is allowed.
|
||||||
http:
|
http:
|
||||||
middlewares:
|
middlewares:
|
||||||
test-ratelimit:
|
test-ratelimit:
|
||||||
rateLimit:
|
rateLimit:
|
||||||
average: 100
|
average: 100
|
||||||
burst: 50
|
burst: 200
|
||||||
```
|
```
|
||||||
|
|
||||||
```toml tab="File (TOML)"
|
```toml tab="File (TOML)"
|
||||||
# Here, an average of 100 requests per second is allowed.
|
# Here, an average of 100 requests per second is allowed.
|
||||||
# In addition, a burst of 50 requests is allowed.
|
# In addition, a burst of 200 requests is allowed.
|
||||||
[http.middlewares]
|
[http.middlewares]
|
||||||
[http.middlewares.test-ratelimit.rateLimit]
|
[http.middlewares.test-ratelimit.rateLimit]
|
||||||
average = 100
|
average = 100
|
||||||
burst = 50
|
burst = 200
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration Options
|
## Configuration Options
|
||||||
|
|
Loading…
Reference in a new issue