From 360c8123714f7374df8ea45932731ddc2a3c77b8 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Thu, 17 Oct 2024 16:19:14 -0400 Subject: [PATCH] chore: move trilium to volsync PVCs --- .../main/apps/default/kustomization.yaml | 2 +- .../default/trilium/app/helm-release.yaml | 61 +++++++++++++++++++ .../trilium/{ => app}/kustomization.yaml | 1 + .../apps/default/trilium/helm-release.yaml | 50 --------------- kubernetes/main/apps/default/trilium/ks.yaml | 32 ++++++++++ 5 files changed, 95 insertions(+), 51 deletions(-) create mode 100644 kubernetes/main/apps/default/trilium/app/helm-release.yaml rename kubernetes/main/apps/default/trilium/{ => app}/kustomization.yaml (54%) delete mode 100644 kubernetes/main/apps/default/trilium/helm-release.yaml create mode 100644 kubernetes/main/apps/default/trilium/ks.yaml diff --git a/kubernetes/main/apps/default/kustomization.yaml b/kubernetes/main/apps/default/kustomization.yaml index 096f6f2..6409c4e 100644 --- a/kubernetes/main/apps/default/kustomization.yaml +++ b/kubernetes/main/apps/default/kustomization.yaml @@ -3,7 +3,7 @@ kind: Kustomization resources: - ./fireflyiii/ks.yaml - ./cdn -- ./trilium +- ./trilium/ks.yaml - ./mealie/ks.yaml - ./huginn - ../../../common/apps/exim/ks.yaml diff --git a/kubernetes/main/apps/default/trilium/app/helm-release.yaml b/kubernetes/main/apps/default/trilium/app/helm-release.yaml new file mode 100644 index 0000000..2f49402 --- /dev/null +++ b/kubernetes/main/apps/default/trilium/app/helm-release.yaml @@ -0,0 +1,61 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2beta2.schema.json +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: trilium + namespace: default +spec: + interval: 5m + chart: + spec: + chart: app-template + version: 3.4.0 + sourceRef: + kind: HelmRepository + name: bjws-charts + namespace: flux-system + + values: + controllers: + main: + containers: + main: + image: + repository: ghcr.io/zadam/trilium + tag: 0.63.7 + env: + TRILIUM_PORT: &port 8080 + service: + app: + controller: main + ports: + http: + port: *port + ingress: + main: + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: websecure + hosts: + - host: "notes.${SECRET_NEW_DOMAIN}" + paths: + - path: / + service: + identifier: app + port: http + persistence: + data: + existingClaim: trilium + globalMounts: + - path: /home/node/trilium-data + temp: + type: persistentVolumeClaim + storageClass: openebs-zfs-mainpool + accessMode: ReadWriteOnce + size: 2G + globalMounts: + - path: /home/node/trilium-data/log + subPath: log + - path: /home/node/trilium-data/sessions + subPath: sessions + - path: /home/node/trilium-data/backup + subPath: backup diff --git a/kubernetes/main/apps/default/trilium/kustomization.yaml b/kubernetes/main/apps/default/trilium/app/kustomization.yaml similarity index 54% rename from kubernetes/main/apps/default/trilium/kustomization.yaml rename to kubernetes/main/apps/default/trilium/app/kustomization.yaml index ea3145d..cc46271 100644 --- a/kubernetes/main/apps/default/trilium/kustomization.yaml +++ b/kubernetes/main/apps/default/trilium/app/kustomization.yaml @@ -1,4 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: +- ../../../../../common/templates/volsync - ./helm-release.yaml \ No newline at end of file diff --git a/kubernetes/main/apps/default/trilium/helm-release.yaml b/kubernetes/main/apps/default/trilium/helm-release.yaml deleted file mode 100644 index 1675224..0000000 --- a/kubernetes/main/apps/default/trilium/helm-release.yaml +++ /dev/null @@ -1,50 +0,0 @@ -apiVersion: helm.toolkit.fluxcd.io/v2 -kind: HelmRelease -metadata: - name: trilium - namespace: default -spec: - interval: 5m - chart: - spec: - chart: app-template - version: 1.3.x - sourceRef: - kind: HelmRepository - name: bjws-charts - namespace: flux-system - - values: - image: - repository: ghcr.io/zadam/trilium - tag: 0.63.7 - - env: - TRILIUM_PORT: &port 8080 - - service: - main: - ports: - http: - port: *port - - ingress: - main: - enabled: true - annotations: - traefik.ingress.kubernetes.io/router.entrypoints: websecure - hosts: - - host: &host "notes.${SECRET_NEW_DOMAIN}" - paths: - - path: / - pathType: Prefix - tls: - - hosts: - - *host - - persistence: - storage: - enabled: true - type: hostPath - hostPath: /mnt/MainPool/Kubernetes/trilium - mountPath: /home/node/trilium-data \ No newline at end of file diff --git a/kubernetes/main/apps/default/trilium/ks.yaml b/kubernetes/main/apps/default/trilium/ks.yaml new file mode 100644 index 0000000..75adc87 --- /dev/null +++ b/kubernetes/main/apps/default/trilium/ks.yaml @@ -0,0 +1,32 @@ +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app trilium + namespace: flux-system +spec: + timeout: 5m + interval: 10m + targetNamespace: default + path: ./kubernetes/main/apps/default/trilium/app + prune: true + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg + dependsOn: + - name: openebs + - name: openebs-sc + - name: volsync + postBuild: + substituteFrom: + - kind: ConfigMap + name: cluster-settings + - kind: Secret + name: cluster-secrets + substitute: + APP: *app + VOLSYNC_CAPACITY: 5Gi \ No newline at end of file