From 50cd91f650cb96484b3dcd0fe664702c9c9ae26c Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Sun, 26 Mar 2023 23:12:02 +0200 Subject: [PATCH] Remvoal of Rendertron --- .../web/rendertron-deployment.yaml | 68 ------------------- .../k3s/templates/networking/ingress.yaml | 5 -- .../middleware/stripprefix-middleware.yaml | 1 - .../k3s/templates/networking/service.yaml | 18 ----- webclient/nginx.conf | 41 ----------- 5 files changed, 133 deletions(-) delete mode 100644 deployment/k3s/templates/deployments/web/rendertron-deployment.yaml diff --git a/deployment/k3s/templates/deployments/web/rendertron-deployment.yaml b/deployment/k3s/templates/deployments/web/rendertron-deployment.yaml deleted file mode 100644 index fbd8c6e5c..000000000 --- a/deployment/k3s/templates/deployments/web/rendertron-deployment.yaml +++ /dev/null @@ -1,68 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: rendertron - labels: - app: navigatum - deployment: rendertron - namespace: {{ $.Values.namespace }} -spec: - replicas: {{ if eq "nav.tum.de" $.Values.url }}2{{ else }}1{{ end }} - revisionHistoryLimit: 1 - selector: - matchLabels: - app: navigatum - deployment: rendertron - strategy: - rollingUpdate: - maxSurge: {{ if eq "nav.tum.de" $.Values.url }}50%{{ else }}100%{{ end }} - maxUnavailable: {{ if eq "nav.tum.de" $.Values.url }}50%{{ else }}0%{{ end }} - type: RollingUpdate - template: - metadata: - labels: - app: navigatum - deployment: rendertron - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: tileserver - operator: In - values: - - ready - volumes: - - name: tmp-rendertron - emptyDir: {} - containers: - - name: rendertron - image: dockette/rendertron - imagePullPolicy: Always - ports: - - containerPort: 3000 - name: rendertron - volumeMounts: - - mountPath: /tmp - name: tmp-rendertron - securityContext: - readOnlyRootFilesystem: true - resources: - requests: - cpu: 50m - memory: 200Mi - limits: - memory: 500Mi - livenessProbe: - httpGet: - path: /_ah/health - port: rendertron - failureThreshold: 1 - periodSeconds: 60 - startupProbe: - httpGet: - path: /_ah/health - port: rendertron - failureThreshold: 20 - periodSeconds: 5 diff --git a/deployment/k3s/templates/networking/ingress.yaml b/deployment/k3s/templates/networking/ingress.yaml index 3e53669b5..5af3aa870 100644 --- a/deployment/k3s/templates/networking/ingress.yaml +++ b/deployment/k3s/templates/networking/ingress.yaml @@ -37,11 +37,6 @@ spec: services: - name: cdn-svc port: 8000 - - kind: Rule - match: Host(`{{ $.Values.url }}`) && PathPrefix(`/rendertron/`) - services: - - name: rendertron-svc - port: 9100 middlewares: - name: stripprefix - kind: Rule diff --git a/deployment/k3s/templates/networking/middleware/stripprefix-middleware.yaml b/deployment/k3s/templates/networking/middleware/stripprefix-middleware.yaml index 17055250e..b9b77ccc7 100644 --- a/deployment/k3s/templates/networking/middleware/stripprefix-middleware.yaml +++ b/deployment/k3s/templates/networking/middleware/stripprefix-middleware.yaml @@ -8,5 +8,4 @@ metadata: spec: stripPrefix: prefixes: - - /rendertron - /maps diff --git a/deployment/k3s/templates/networking/service.yaml b/deployment/k3s/templates/networking/service.yaml index 5f0f67cce..f1dc529ac 100644 --- a/deployment/k3s/templates/networking/service.yaml +++ b/deployment/k3s/templates/networking/service.yaml @@ -108,21 +108,3 @@ spec: - name: webclient port: 9000 targetPort: 80 ---- -apiVersion: v1 -kind: Service -metadata: - name: rendertron-svc - labels: - app: navigatum - deployment: rendertron - namespace: {{ $.Values.namespace }} -spec: - type: ClusterIP - selector: - app: navigatum - deployment: rendertron - ports: - - name: rendertron - port: 9100 - targetPort: 3000 diff --git a/webclient/nginx.conf b/webclient/nginx.conf index e59504734..34f88e70a 100644 --- a/webclient/nginx.conf +++ b/webclient/nginx.conf @@ -44,31 +44,6 @@ http { "de" "de"; } - # bot without js-execution workaround - # see https://github.com/GoogleChrome/rendertron/blob/main/middleware/src/middleware.ts#L24-L41 - map $http_user_agent $no_js_exec { - default 0; - '~*Baiduspider' 1; - '~*bingbot' 1; - '~*Embedly' 1; - '~*facebookexternalhit' 1; - '~*LinkedInBot' 1; - '~*outbrain' 1; - '~*pinterest' 1; - '~*quora link preview' 1; - '~*rogerbot' 1; - '~*showyoubot' 1; - '~*Slackbot' 1; - '~*TelegramBot' 1; - '~*Twitterbot' 1; - '~*vkShare' 1; - '~*W3C_Validator' 1; - '~*WhatsApp' 1; - '~*Discordbot' 1; - '~*googlebot' 1; - '~*SemrushBot' 1; - } - server { # default_server makes nginx not care about HOST, we hande this upstream by Traefik listen 80 default_server; @@ -97,22 +72,6 @@ http { return 200 'healthy'; } - if ($no_js_exec = 1) { - rewrite ^/(((api|search|about|view|campus|site|building|room)/?.*)?)$ /rendertron/$1; - } - # equivalent to: - #if ($uri ~ ^/((\.well-known|assets)/.*|(robots.txt|googlebef9161f1176c5e0.html|adds.txt|app-ads.txt|favicon.ico|health|404.html|50x.html))$){ - # set $no_js_exec 0; - #} - - #render all pages, that could execute js via rendertron - location ^~ /rendertron/ { - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header User-Agent 'Rendertron'; - proxy_pass https://rendertron.navigatum-scv.svc.cluster.local/rendertron/render/https://nav.tum.de$request_uri; - } - location / { add_header Cache-Control no-cache; # disable caching, as we do not want to have theme/language related issues expires 360s; # 360s=5min