freescout: refactor deployment for custom image and s3 support

This commit is contained in:
Erki Aas 2023-08-01 14:50:09 +03:00
parent cf8ca7457b
commit 7e1c99f12d

View File

@ -72,6 +72,7 @@ spec:
ports: ports:
- protocol: TCP - protocol: TCP
port: 80 port: 80
targetPort: 8080
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
@ -90,24 +91,25 @@ spec:
app: freescout app: freescout
spec: spec:
containers: containers:
- name: oidc-gateway - name: freescout
image: harbor.k-space.ee/k-space/freescout # image: harbor.k-space.ee/k-space/freescout
image: ghcr.io/codemowers/freescout
ports: ports:
- containerPort: 80 - containerPort: 8080
env: env:
- name: ENABLE_AUTO_UPDATE
value: 'false'
- name: DISPLAY_ERRORS - name: DISPLAY_ERRORS
value: 'true' value: 'true'
- name: SITE_URL - name: SITE_URL
value: 'https://freescout.k-space.ee' value: 'https://freescout.k-space.ee'
- name: APP_URL
value: 'https://freescout.k-space.ee'
- name: DB_HOST - name: DB_HOST
value: mariadb.infra.k-space.ee value: mariadb.infra.k-space.ee
- name: DB_PORT - name: DB_PORT
value: "3306" value: "3306"
- name: DB_NAME - name: DB_DATABASE
value: kspace_freescout value: kspace_freescout
- name: DB_USER - name: DB_USERNAME
value: kspace_freescout value: kspace_freescout
- name: ADMIN_EMAIL - name: ADMIN_EMAIL
value: lauri@k-space.ee value: lauri@k-space.ee
@ -115,18 +117,95 @@ spec:
value: Salakala1! value: Salakala1!
- name: TIMEZONE - name: TIMEZONE
value: Europe/Tallinn value: Europe/Tallinn
- name: DB_PASS - name: FREESCOUT_ATTACHMENTS_DRIVER
value: s3
- name: DB_PASSWORD
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: freescout-secrets name: freescout-secrets
key: DB_PASS key: DB_PASS
volumeMounts: - name: AWS_BUCKET
- mountPath: /www/html/Modules valueFrom:
name: modules secretKeyRef:
volumes: name: miniobucket-attachments-owner-secrets
- name: modules key: BUCKET_NAME
emptyDir: - name: APP_KEY
sizeLimit: 500Mi 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 apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule kind: PrometheusRule