1
0
Fork 0
mirror of https://code.forgejo.org/infrastructure/documentation synced 2024-11-25 04:01:12 +00:00

traefik: apply forgejo-ratelimit once

This commit is contained in:
Earl Warren 2024-10-22 17:06:39 +02:00
parent e0f3e624bc
commit f5861bf000
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
3 changed files with 10 additions and 9 deletions

View file

@ -199,6 +199,7 @@ function setup_k8s_apply() {
function setup_k8s_traefik() { function setup_k8s_traefik() {
# https://github.com/traefik/traefik-helm-chart?tab=readme-ov-file#deploying-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 $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() { function setup_k8s_nfs() {

View file

@ -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

View file

@ -24,15 +24,6 @@ service:
port: 2222 port: 2222
extraDeploy: 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 # Route from traefik to forgejo
- apiVersion: traefik.io/v1alpha1 - apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP kind: IngressRouteTCP