blob: c1390e0a1aa551b0e3198266b3f37845d74c823b [file] [log] [blame]
Matthias Andreas Benkard341525c2026-11-05 19:12:05 +01001# Middlewares attached to Traefik's entrypoints (see ports.*.http.middlewares
2# in traefik/values.yaml). Apply this file before upgrading the Helm release:
3# a missing entrypoint middleware breaks every router.
4#
5# kubectl apply -f traefik/middlewares.yaml
6
7# Per-client-IP rate limit for all routes (IngressRoutes as well as the
8# nginx-class Ingresses). Traefik instantiates entrypoint middlewares per
9# router, so the bucket is per IP *and* router, not global per IP. Clients
10# over the limit get 429. The cgit per-host cap (mulk/git-cgit-ratelimit in
11# git/git.yaml) applies on top of this.
12#
13# Traefik sits on hostPorts without a proxy in front, so the remote address is
14# the real client; X-Forwarded-For is never trusted (depth 0).
15apiVersion: traefik.io/v1alpha1
16kind: Middleware
17metadata:
18 name: ratelimit-per-ip
19 namespace: traefik
20spec:
21 rateLimit:
22 average: 10
23 period: 1s
24 burst: 100
25 sourceCriterion:
26 ipStrategy:
27 depth: 0
28 # One bucket per IPv6 /64 rather than per address.
29 ipv6Subnet: 64