From 6a972882498a105631135822236078bcfc8aa653 Mon Sep 17 00:00:00 2001 From: trivernis Date: Mon, 9 Oct 2023 16:12:43 +0200 Subject: [PATCH] Remove unused tandoor middleware --- apps/tandoor/app/deploy.yaml | 191 ---------------------------------- apps/tandoor/app/release.yaml | 2 +- apps/tandoor/app/route.yaml | 12 --- 3 files changed, 1 insertion(+), 204 deletions(-) delete mode 100644 apps/tandoor/app/deploy.yaml diff --git a/apps/tandoor/app/deploy.yaml b/apps/tandoor/app/deploy.yaml deleted file mode 100644 index 85f4325..0000000 --- a/apps/tandoor/app/deploy.yaml +++ /dev/null @@ -1,191 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: recipes - namespace: tandoor - labels: - app: recipes - environment: production - tier: frontend -spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: recipes - environment: production - template: - metadata: - labels: - app: recipes - tier: frontend - environment: production - spec: - restartPolicy: Always - serviceAccount: recipes - serviceAccountName: recipes - initContainers: - - name: init-chmod-data - env: - - name: SECRET_KEY - valueFrom: - secretKeyRef: - name: recipes-secret - key: secret-key - - name: DB_ENGINE - value: django.db.backends.postgresql_psycopg2 - - name: POSTGRES_HOST - value: recipes-db - - name: POSTGRES_PORT - value: "5432" - - name: POSTGRES_USER - value: postgres - - name: POSTGRES_DB - value: postgres - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: recipes-secret - key: postgresql-password - image: vabene1111/recipes - imagePullPolicy: Always - resources: - requests: - cpu: 250m - memory: 64Mi - command: - - sh - - -c - - | - set -e - source venv/bin/activate - echo "Updating database" - python manage.py migrate - python manage.py collectstatic_js_reverse - python manage.py collectstatic --noinput - echo "Setting media file attributes" - chown -R 65534:65534 /opt/recipes/mediafiles - find /opt/recipes/mediafiles -type d | xargs -r chmod 755 - find /opt/recipes/mediafiles -type f | xargs -r chmod 644 - echo "Done" - securityContext: - runAsUser: 0 - volumeMounts: - - mountPath: /opt/recipes/mediafiles - name: media - # mount as subPath due to lost+found on ext4 pvc - subPath: files - - mountPath: /opt/recipes/staticfiles - name: static - # mount as subPath due to lost+found on ext4 pvc - subPath: files - containers: - - name: recipes-nginx - image: nginx:alpine-slim - imagePullPolicy: IfNotPresent - ports: - - containerPort: 80 - protocol: TCP - name: http - - containerPort: 8080 - protocol: TCP - name: gunicorn - resources: - requests: - cpu: 250m - memory: 64Mi - volumeMounts: - - mountPath: /media - name: media - # mount as subPath due to lost+found on ext4 pvc - subPath: files - - mountPath: /static - name: static - # mount as subPath due to lost+found on ext4 pvc - subPath: files - - name: nginx-config - mountPath: /etc/nginx/nginx.conf - subPath: nginx-config - readOnly: true - - name: recipes - image: vabene1111/recipes - imagePullPolicy: IfNotPresent - command: - - /opt/recipes/venv/bin/gunicorn - - -b - - :8080 - - --access-logfile - - "-" - - --error-logfile - - "-" - - --log-level - - INFO - - recipes.wsgi - livenessProbe: - failureThreshold: 3 - httpGet: - path: / - port: 8080 - scheme: HTTP - periodSeconds: 30 - readinessProbe: - httpGet: - path: / - port: 8080 - scheme: HTTP - periodSeconds: 30 - resources: - requests: - cpu: 250m - memory: 64Mi - volumeMounts: - - mountPath: /opt/recipes/mediafiles - name: media - # mount as subPath due to lost+found on ext4 pvc - subPath: files - - mountPath: /opt/recipes/staticfiles - name: static - # mount as subPath due to lost+found on ext4 pvc - subPath: files - env: - - name: DEBUG - value: "0" - - name: ALLOWED_HOSTS - value: "*" - - name: CSRF_TRUSTED_ORIGINS - value: "https://recipes.trivernis.net" - - name: SECRET_KEY - valueFrom: - secretKeyRef: - name: recipes-secret - key: secret-key - - name: GUNICORN_MEDIA - value: "0" - - name: DB_ENGINE - value: django.db.backends.postgresql_psycopg2 - - name: POSTGRES_HOST - value: recipes-db - - name: POSTGRES_PORT - value: "5432" - - name: POSTGRES_USER - value: postgres - - name: POSTGRES_DB - value: postgres - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: recipes-secret - key: postgresql-password - securityContext: - runAsUser: 65534 - volumes: - - name: media - persistentVolumeClaim: - claimName: recipes-media - - name: static - persistentVolumeClaim: - claimName: recipes-static - - name: nginx-config - configMap: - name: recipes-nginx-config \ No newline at end of file diff --git a/apps/tandoor/app/release.yaml b/apps/tandoor/app/release.yaml index 71c9000..1b8ae18 100644 --- a/apps/tandoor/app/release.yaml +++ b/apps/tandoor/app/release.yaml @@ -28,7 +28,7 @@ spec: env: TIMEZONE: Europe/Berlin ALLOWED_HOSTS: '*' - CSRF_TRUSTED_ORIGINS: https://recipes.trivernis.dev + CSRF_TRUSTED_ORIGINS: https://recipes.trivernis.net DB_ENGINE: django.db.backends.postgresql_psycopg2 POSTGRES_HOST: recipes-db POSTGRES_PORT: 5432 diff --git a/apps/tandoor/app/route.yaml b/apps/tandoor/app/route.yaml index b65b27e..7794e9b 100644 --- a/apps/tandoor/app/route.yaml +++ b/apps/tandoor/app/route.yaml @@ -1,14 +1,4 @@ apiVersion: traefik.containo.us/v1alpha1 -kind: Middleware -metadata: - name: tandoor-headers - namespace: tandoor -spec: - headers: - frameDeny: true - browserXssFilter: true ---- -apiVersion: traefik.containo.us/v1alpha1 kind: IngressRoute metadata: name: recipes-route @@ -24,8 +14,6 @@ spec: port: 80 - match: Host(`recipes.trivernis.dev`) || Host(`recipes.trivernis.net`) kind: Rule - middlewares: - - name: tandoor-headers services: - name: tandoor port: 8080 \ No newline at end of file