From 7e1c99f12d63b7c2cb7ebd9b476a18fecb20b2eb Mon Sep 17 00:00:00 2001 From: Erki Aas Date: Tue, 1 Aug 2023 14:50:09 +0300 Subject: [PATCH] freescout: refactor deployment for custom image and s3 support --- freescout/application.yml | 109 ++++++++++++++++++++++++++++++++------ 1 file changed, 94 insertions(+), 15 deletions(-) diff --git a/freescout/application.yml b/freescout/application.yml index 887115f..619e939 100644 --- a/freescout/application.yml +++ b/freescout/application.yml @@ -72,6 +72,7 @@ spec: ports: - protocol: TCP port: 80 + targetPort: 8080 --- apiVersion: apps/v1 kind: Deployment @@ -90,24 +91,25 @@ spec: app: freescout spec: containers: - - name: oidc-gateway - image: harbor.k-space.ee/k-space/freescout + - name: freescout + # image: harbor.k-space.ee/k-space/freescout + image: ghcr.io/codemowers/freescout ports: - - containerPort: 80 + - containerPort: 8080 env: - - name: ENABLE_AUTO_UPDATE - value: 'false' - name: DISPLAY_ERRORS value: 'true' - name: SITE_URL value: 'https://freescout.k-space.ee' + - name: APP_URL + value: 'https://freescout.k-space.ee' - name: DB_HOST value: mariadb.infra.k-space.ee - name: DB_PORT value: "3306" - - name: DB_NAME + - name: DB_DATABASE value: kspace_freescout - - name: DB_USER + - name: DB_USERNAME value: kspace_freescout - name: ADMIN_EMAIL value: lauri@k-space.ee @@ -115,18 +117,95 @@ spec: value: Salakala1! - name: TIMEZONE value: Europe/Tallinn - - name: DB_PASS + - name: FREESCOUT_ATTACHMENTS_DRIVER + value: s3 + - name: DB_PASSWORD valueFrom: secretKeyRef: name: freescout-secrets key: DB_PASS - volumeMounts: - - mountPath: /www/html/Modules - name: modules - volumes: - - name: modules - emptyDir: - sizeLimit: 500Mi + - name: AWS_BUCKET + valueFrom: + secretKeyRef: + name: miniobucket-attachments-owner-secrets + key: BUCKET_NAME + - name: APP_KEY + valueFrom: + secretKeyRef: + name: freescout-app + key: APP_KEY + envFrom: + - secretRef: + name: miniobucket-attachments-owner-secrets +--- +apiVersion: batch/v1 +kind: CronJob +metadata: + name: freescout-cron +spec: + schedule: "0,30 * * * *" # Should be every minute in theory, keeps hanging + jobTemplate: + spec: + template: + spec: + containers: + - name: freescout-cron + image: ghcr.io/codemowers/freescout + imagePullPolicy: Always + command: + - php + - artisan + - schedule:run + env: + - name: DISPLAY_ERRORS + value: 'true' + - name: SITE_URL + value: 'https://freescout.k-space.ee' + - name: APP_URL + value: 'https://freescout.k-space.ee' + - name: DB_HOST + value: mariadb.infra.k-space.ee + - name: DB_PORT + value: "3306" + - name: DB_DATABASE + value: kspace_freescout + - name: DB_USERNAME + value: kspace_freescout + - name: ADMIN_EMAIL + value: lauri@k-space.ee + - name: ADMIN_PASS + value: Salakala1! + - name: TIMEZONE + value: Europe/Tallinn + - name: FREESCOUT_ATTACHMENTS_DRIVER + value: s3 + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: freescout-secrets + key: DB_PASS + - name: AWS_BUCKET + valueFrom: + secretKeyRef: + name: miniobucket-attachments-owner-secrets + key: BUCKET_NAME + - name: APP_KEY + valueFrom: + secretKeyRef: + name: freescout-app + key: APP_KEY + envFrom: + - secretRef: + name: miniobucket-attachments-owner-secrets + restartPolicy: Never +--- +apiVersion: codemowers.cloud/v1beta1 +kind: MinioBucketClaim +metadata: + name: attachments +spec: + capacity: 10Gi + class: external --- apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule