diff --git a/apps/lychee/app.yaml b/apps/lychee/app.yaml new file mode 100644 index 0000000..6b04f14 --- /dev/null +++ b/apps/lychee/app.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: lychee +metadata: + name: lychee +resources: + - app/namespace.yaml + - app/volume.yaml + - app/deploy.yaml + - app/service.yaml + - app/route.yaml diff --git a/apps/lychee/app/deploy.yaml b/apps/lychee/app/deploy.yaml new file mode 100644 index 0000000..2ddc47e --- /dev/null +++ b/apps/lychee/app/deploy.yaml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: lychee + namespace: lychee + labels: + app: lychee +spec: + replicas: 1 + selector: + matchLabels: + app: lychee + template: + metadata: + labels: + app: lychee + spec: + containers: + - image: lycheeorg/lychee:v5.1.2 + name: lychee + volumeMounts: + - name: lychee-files + mountPath: "/lychee/uploads" + - name: lychee-config + mountPath: "/lychee/conf" + - name: lychee-sym + mountPath: "/lychee/sym" + - name: lychee-sqlite + mountPath: "/lychee/db" + ports: + - containerPort: 80 + name: http + protocol: TCP + env: + - name: PHP_TZ + value: Europe/Berlin + - name: TIMEZONE + value: Europe/Berlin + - name: DB_CONNECTION + value: sqlite + - name: DB_DATABSE + value: /lychee/db/lychee.db + - name: APP_URL + value: https://lychee.trivernis.net + volumes: + - name: lychee-sym + persistentVolumeClaim: + claimName: lychee-sym-pvc + - name: lychee-sqlite + persistentVolumeClaim: + claimName: lychee-sqlite-pvc + - name: lychee-uploads + persistentVolumeClaim: + claimName: lychee-uploads-pvc + - name: lychee-config + persistentVolumeClaim: + claimName: lychee-config-pvc diff --git a/apps/lychee/app/namespace.yaml b/apps/lychee/app/namespace.yaml new file mode 100644 index 0000000..715ad19 --- /dev/null +++ b/apps/lychee/app/namespace.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: lychee + labels: + name: lychee diff --git a/apps/lychee/app/route.yaml b/apps/lychee/app/route.yaml new file mode 100644 index 0000000..24fbb42 --- /dev/null +++ b/apps/lychee/app/route.yaml @@ -0,0 +1,17 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: web + namespace: lychee +spec: + entryPoints: + - web + routes: + - match: Host(`lychee.trivernis.net`, `lychee.iulse.com`) + kind: Rule + middlewares: + - name: strict-security-headers + namespace: default + services: + - name: lychee + port: http diff --git a/apps/lychee/app/service.yaml b/apps/lychee/app/service.yaml new file mode 100644 index 0000000..37bba98 --- /dev/null +++ b/apps/lychee/app/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: lychee + namespace: lychee +spec: + ports: + - name: http + port: 80 + protocol: TCP + targetPort: http + selector: + app: lychee + type: ClusterIP + diff --git a/apps/lychee/app/volume.yaml b/apps/lychee/app/volume.yaml new file mode 100644 index 0000000..b1670d2 --- /dev/null +++ b/apps/lychee/app/volume.yaml @@ -0,0 +1,51 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: lychee-uploads-pvc + namespace: lychee +spec: + accessModes: + - ReadWriteOnce + storageClassName: "ebs-hdd" + resources: + requests: + storage: 10Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: lychee-sym-pvc + namespace: lychee +spec: + accessModes: + - ReadWriteOnce + storageClassName: "ebs-ssd" + resources: + requests: + storage: 1Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: lychee-sqlite-pvc + namespace: lychee +spec: + accessModes: + - ReadWriteOnce + storageClassName: "ebs-ssd" + resources: + requests: + storage: 1Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: lychee-config-pvc + namespace: lychee +spec: + accessModes: + - ReadWriteOnce + storageClassName: "ebs-ssd" + resources: + requests: + storage: 1Gi diff --git a/cluster/apps.yaml b/cluster/apps.yaml index f5b98be..61645d3 100644 --- a/cluster/apps.yaml +++ b/cluster/apps.yaml @@ -354,3 +354,20 @@ spec: prune: true wait: true timeout: 5m0s +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: apps-lychee + namespace: flux-system +spec: + dependsOn: + - name: repos + interval: 5m + sourceRef: + kind: GitRepository + name: flux-system + path: ./apps/lychee + prune: true + wait: true + timeout: 5m0s