From 0f9b5ff8e2a81337aae57dcb7d703aed50e744e0 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 22 Oct 2024 10:21:54 +0200 Subject: [PATCH] next.forgejo.org: no more than 10 request per second --- k8s-forgejo/next-values.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/k8s-forgejo/next-values.yml b/k8s-forgejo/next-values.yml index b7bcdc8..5921a90 100644 --- a/k8s-forgejo/next-values.yml +++ b/k8s-forgejo/next-values.yml @@ -5,6 +5,10 @@ image: rootless: false ingress: + annotations: + # https://doc.traefik.io/traefik/v2.10/routing/providers/kubernetes-ingress/#on-ingress + # reference middlewares via `-@kubernetescrd` + traefik.ingress.kubernetes.io/router.middlewares: default-forgejo-ratelimit@kubernetescrd tls: - hosts: - next.forgejo.org @@ -20,6 +24,15 @@ service: port: 2222 extraDeploy: + - apiVersion: traefik.io/v1alpha1 + kind: Middleware + metadata: + name: forgejo-ratelimit + spec: + # https://doc.traefik.io/traefik/v2.10/middlewares/http/ratelimit/ + rateLimit: + average: 10 + burst: 20 # Route from traefik to forgejo - apiVersion: traefik.io/v1alpha1 kind: IngressRouteTCP