From 5792367b8bc6df7c386a002b4674a2387e9c4a62 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Wed, 10 Jan 2024 13:15:42 +0100 Subject: [PATCH] Add finance to auto deploy --- apps/finance/actualbudget.deployment.yaml | 68 +--------------- apps/finance/actualbudget.ingress.yaml | 15 ++++ apps/finance/actualbudget.pvc.yaml | 27 +++++++ apps/finance/actualbudget.service.yaml | 12 +++ apps/finance/firefly-importer.deployment.yaml | 66 ---------------- apps/finance/firefly.deployment.yaml | 79 ------------------- apps/finance/firefly.pvc.yaml | 34 -------- apps/finance/kustomization.yaml | 16 ++++ apps/finance/namespace.yaml | 4 + kluster-deployments/finance/application.yaml | 18 +++++ .../finance/kustomization.yaml | 4 + kluster-deployments/kustomization.yaml | 1 + 12 files changed, 98 insertions(+), 246 deletions(-) create mode 100644 apps/finance/actualbudget.ingress.yaml create mode 100644 apps/finance/actualbudget.pvc.yaml create mode 100644 apps/finance/actualbudget.service.yaml delete mode 100644 apps/finance/firefly-importer.deployment.yaml delete mode 100644 apps/finance/firefly.deployment.yaml delete mode 100644 apps/finance/firefly.pvc.yaml create mode 100644 apps/finance/kustomization.yaml create mode 100644 apps/finance/namespace.yaml create mode 100644 kluster-deployments/finance/application.yaml create mode 100644 kluster-deployments/finance/kustomization.yaml diff --git a/apps/finance/actualbudget.deployment.yaml b/apps/finance/actualbudget.deployment.yaml index 5565cbc..1eb63dc 100644 --- a/apps/finance/actualbudget.deployment.yaml +++ b/apps/finance/actualbudget.deployment.yaml @@ -1,12 +1,10 @@ apiVersion: apps/v1 kind: Deployment metadata: - namespace: finance name: actualbudget labels: app: actualbudget spec: -# deployment running a single container selector: matchLabels: app: actualbudget @@ -18,7 +16,7 @@ spec: spec: containers: - name: actualbudget - image: actualbudget/actual-server:latest + image: actualbudget imagePullPolicy: Always env: - name: TZ @@ -34,67 +32,3 @@ spec: - name: actualbudget-data-nfs persistentVolumeClaim: claimName: actualbudget-data-nfs ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - namespace: finance - name: "actualbudget-data-nfs" -spec: - # storageClassName: fast - capacity: - storage: "5Gi" - accessModes: - - ReadWriteOnce - nfs: - path: /export/kluster/actualbudget - server: 192.168.1.157 - ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - namespace: finance - name: "actualbudget-data-nfs" -spec: - storageClassName: "fast" - accessModes: - - ReadWriteOnce - resources: - requests: - storage: "5Gi" - # selector: - # matchLabels: - # directory: "journal-data" - ---- -apiVersion: v1 -kind: Service -metadata: - namespace: finance - name: actualbudget -spec: - selector: - app: actualbudget - ports: - - protocol: TCP - port: 5006 - targetPort: 5006 - type: ClusterIP ---- -apiVersion: traefik.containo.us/v1alpha1 -kind: IngressRoute -metadata: - namespace: finance - name: actualbudget -spec: - entryPoints: - - websecure - routes: - - match: Host(`actualbudget.kluster.moll.re`) - kind: Rule - services: - - name: actualbudget - port: 5006 - tls: - certResolver: default-tls diff --git a/apps/finance/actualbudget.ingress.yaml b/apps/finance/actualbudget.ingress.yaml new file mode 100644 index 0000000..65d6e2d --- /dev/null +++ b/apps/finance/actualbudget.ingress.yaml @@ -0,0 +1,15 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: actualbudget +spec: + entryPoints: + - websecure + routes: + - match: Host(`actualbudget.kluster.moll.re`) + kind: Rule + services: + - name: actualbudget + port: 5006 + tls: + certResolver: default-tls diff --git a/apps/finance/actualbudget.pvc.yaml b/apps/finance/actualbudget.pvc.yaml new file mode 100644 index 0000000..b138777 --- /dev/null +++ b/apps/finance/actualbudget.pvc.yaml @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: "actualbudget-data-nfs" +spec: + capacity: + storage: "5Gi" + accessModes: + - ReadWriteOnce + nfs: + path: /export/kluster/actualbudget + server: 192.168.1.157 + +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: "actualbudget-data-nfs" +spec: + storageClassName: "" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: "5Gi" + + volumeName: actualbudget-data-nfs diff --git a/apps/finance/actualbudget.service.yaml b/apps/finance/actualbudget.service.yaml new file mode 100644 index 0000000..b975887 --- /dev/null +++ b/apps/finance/actualbudget.service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: actualbudget +spec: + selector: + app: actualbudget + ports: + - protocol: TCP + port: 5006 + targetPort: 5006 + type: ClusterIP \ No newline at end of file diff --git a/apps/finance/firefly-importer.deployment.yaml b/apps/finance/firefly-importer.deployment.yaml deleted file mode 100644 index 03872e0..0000000 --- a/apps/finance/firefly-importer.deployment.yaml +++ /dev/null @@ -1,66 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: firefly-importer - name: firefly-importer - namespace: finance -spec: - selector: - matchLabels: - app: firefly-importer - template: - metadata: - labels: - app: firefly-importer - spec: - containers: - - image: fireflyiii/data-importer:latest - imagePullPolicy: Always - name: firefly-importer - resources: {} - ports: - - containerPort: 8080 - env: - - name: FIREFLY_III_ACCESS_TOKEN - value: redacted - - name: FIREFLY_III_URL - value: firefly-http:8080 - # - name: APP_URL - # value: https://finance.kluster.moll.re - - name: TRUSTED_PROXIES - value: "**" - ---- -apiVersion: v1 -kind: Service -metadata: - name: firefly-importer-http - namespace: finance - labels: - app: firefly-importer-http - -spec: - type: ClusterIP - ports: - - port: 8080 - # name: http - selector: - app: firefly-importer ---- -apiVersion: traefik.containo.us/v1alpha1 -kind: IngressRoute -metadata: - name: firefly-importer-ingress - namespace: finance -spec: - entryPoints: - - websecure - routes: - - match: Host(`importer.finance.kluster.moll.re`) - kind: Rule - services: - - name: firefly-importer-http - port: 8080 - tls: - certResolver: default-tls \ No newline at end of file diff --git a/apps/finance/firefly.deployment.yaml b/apps/finance/firefly.deployment.yaml deleted file mode 100644 index e109a72..0000000 --- a/apps/finance/firefly.deployment.yaml +++ /dev/null @@ -1,79 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: firefly - name: firefly - namespace: finance -spec: - selector: - matchLabels: - app: firefly - template: - metadata: - labels: - app: firefly - spec: - containers: - - image: fireflyiii/core:latest - imagePullPolicy: Always - name: firefly - resources: {} - ports: - - containerPort: 8080 - env: - - name: APP_ENV - value: "local" - - name: APP_KEY - value: iKejRAlgwx2Y/fxdosXjABbNxNzEuJdl - - name: DB_CONNECTION - value: sqlite - - name: APP_URL - value: https://finance.kluster.moll.re - - name: TRUSTED_PROXIES - value: "**" - volumeMounts: - - mountPath: /var/www/html/storage/database - name: firefly-database - - - volumes: - - name: firefly-database - persistentVolumeClaim: - claimName: firefly-database-nfs - ---- -apiVersion: v1 -kind: Service -metadata: - name: firefly-http - namespace: finance - labels: - app: firefly-http - -spec: - type: ClusterIP - ports: - - port: 8080 - # name: http - selector: - app: firefly ---- -apiVersion: traefik.containo.us/v1alpha1 -kind: IngressRoute -metadata: - name: firefly-ingress - namespace: finance -spec: - entryPoints: - - websecure - routes: - - match: Host(`finance.kluster.moll.re`) - kind: Rule - services: - - name: firefly-http - port: 8080 - tls: - certResolver: default-tls - - diff --git a/apps/finance/firefly.pvc.yaml b/apps/finance/firefly.pvc.yaml deleted file mode 100644 index fe5def5..0000000 --- a/apps/finance/firefly.pvc.yaml +++ /dev/null @@ -1,34 +0,0 @@ ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - namespace: finance - name: firefly-database-nfs - labels: - directory: firefly -spec: - # storageClassName: fast - # volumeMode: Filesystem - accessModes: - - ReadOnlyMany - capacity: - storage: "1G" - - nfs: - path: /firefly # inside nfs part. - server: 10.43.239.43 # assigned to nfs-server service. Won't change as long as service is not redeployed ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - namespace: finance - name: firefly-database-nfs -spec: - resources: - requests: - storage: "1G" - # storageClassName: fast - accessModes: - - ReadOnlyMany - volumeName: firefly-database-nfs - diff --git a/apps/finance/kustomization.yaml b/apps/finance/kustomization.yaml new file mode 100644 index 0000000..23875fd --- /dev/null +++ b/apps/finance/kustomization.yaml @@ -0,0 +1,16 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: finance + +resources: + - namespace.yaml + - actualbudget.pvc.yaml + - actualbudget.deployment.yaml + - actualbudget.service.yaml + - actualbudget.ingress.yaml + +images: + - name: actualbudget + newName: actualbudget/actual-server + newTag: 23.12.1 diff --git a/apps/finance/namespace.yaml b/apps/finance/namespace.yaml new file mode 100644 index 0000000..0a074bd --- /dev/null +++ b/apps/finance/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: placeholder diff --git a/kluster-deployments/finance/application.yaml b/kluster-deployments/finance/application.yaml new file mode 100644 index 0000000..a01e519 --- /dev/null +++ b/kluster-deployments/finance/application.yaml @@ -0,0 +1,18 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: finance-application + namespace: argocd +spec: + project: apps + source: + repoURL: ssh://git@git.kluster.moll.re:2222/remoll/k3s-infra.git + targetRevision: main + path: apps/finance + destination: + server: https://kubernetes.default.svc + namespace: finance + syncPolicy: + automated: + prune: true + selfHeal: true diff --git a/kluster-deployments/finance/kustomization.yaml b/kluster-deployments/finance/kustomization.yaml new file mode 100644 index 0000000..0b082ba --- /dev/null +++ b/kluster-deployments/finance/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- application.yaml \ No newline at end of file diff --git a/kluster-deployments/kustomization.yaml b/kluster-deployments/kustomization.yaml index a37be02..739b28d 100644 --- a/kluster-deployments/kustomization.yaml +++ b/kluster-deployments/kustomization.yaml @@ -34,3 +34,4 @@ resources: - media/ - nextcloud/ - syncthing/ + - finance/