From f5861bf00061226bb48dc809d29569b8f3c80f4b Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 22 Oct 2024 17:06:39 +0200 Subject: [PATCH] traefik: apply forgejo-ratelimit once --- k3s-host/setup.sh | 1 + k3s-host/traefik-rate-limit.yml | 9 +++++++++ k8s-forgejo/next-values.yml | 9 --------- 3 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 k3s-host/traefik-rate-limit.yml diff --git a/k3s-host/setup.sh b/k3s-host/setup.sh index 9bc14d5..8226d9f 100755 --- a/k3s-host/setup.sh +++ b/k3s-host/setup.sh @@ -199,6 +199,7 @@ function setup_k8s_apply() { function setup_k8s_traefik() { # https://github.com/traefik/traefik-helm-chart?tab=readme-ov-file#deploying-traefik $SELF_DIR/subst.sh traefik.yml | helm upgrade --install --namespace kube-system traefik -f - --set installCRDs=true --version $TRAEFIK_VERSION oci://ghcr.io/traefik/helm/traefik + setup_k8s_apply traefik-rate-limit.yml } function setup_k8s_nfs() { diff --git a/k3s-host/traefik-rate-limit.yml b/k3s-host/traefik-rate-limit.yml new file mode 100644 index 0000000..ef00a4d --- /dev/null +++ b/k3s-host/traefik-rate-limit.yml @@ -0,0 +1,9 @@ +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: forgejo-ratelimit +spec: + # https://doc.traefik.io/traefik/v3.1/middlewares/http/ratelimit/ + rateLimit: + average: 10 + burst: 20 diff --git a/k8s-forgejo/next-values.yml b/k8s-forgejo/next-values.yml index a95b242..08fdd81 100644 --- a/k8s-forgejo/next-values.yml +++ b/k8s-forgejo/next-values.yml @@ -24,15 +24,6 @@ service: port: 2222 extraDeploy: - - apiVersion: traefik.io/v1alpha1 - kind: Middleware - metadata: - name: forgejo-ratelimit - spec: - # https://doc.traefik.io/traefik/v3.1/middlewares/http/ratelimit/ - rateLimit: - average: 10 - burst: 20 # Route from traefik to forgejo - apiVersion: traefik.io/v1alpha1 kind: IngressRouteTCP