From aed8a8ae49a1f05017ce60ad7a172d1248852db5 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Sat, 17 Jun 2023 15:09:11 -0400 Subject: [PATCH] add cronjob for fireflyiii --- .../default/fireflyiii/daily-cronjob.yaml | 34 +++++++++++++++++++ .../default/fireflyiii/env-secret.sops.yaml | 5 +-- .../default/fireflyiii/kustomization.yaml | 3 +- 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 cluster/apps/default/fireflyiii/daily-cronjob.yaml diff --git a/cluster/apps/default/fireflyiii/daily-cronjob.yaml b/cluster/apps/default/fireflyiii/daily-cronjob.yaml new file mode 100644 index 0000000..9263e51 --- /dev/null +++ b/cluster/apps/default/fireflyiii/daily-cronjob.yaml @@ -0,0 +1,34 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: firefly-cronjob + namespace: default +spec: + # 0am every day + schedule: "0 0 * * *" + successfulJobsHistoryLimit: 1 + failedJobsHistoryLimit: 2 + jobTemplate: + spec: + template: + spec: + containers: + - name: firefly-cronjob + image: frolvlad/alpine-bash + imagePullPolicy: IfNotPresent + command: + - /bin/bash + - -c + - wget -qO- https://firefly-iii.default/api/v1/cron/$(cat /etc/crontoken) + volumeMounts: + - name: ff-secret + mountPath: /etc/crontoken + subPath: STATIC_CRON_TOKEN + securityContext: + runAsNonRoot: true + runAsUser: 1000 + restartPolicy: OnFailure + volumes: + - name: ff-secret + secret: + secretName: firefly-env-secret \ No newline at end of file diff --git a/cluster/apps/default/fireflyiii/env-secret.sops.yaml b/cluster/apps/default/fireflyiii/env-secret.sops.yaml index cd19c96..620a1bb 100644 --- a/cluster/apps/default/fireflyiii/env-secret.sops.yaml +++ b/cluster/apps/default/fireflyiii/env-secret.sops.yaml @@ -67,14 +67,15 @@ stringData: SITE_OWNER: ENC[AES256_GCM,data:KbzTQ/QdlMmxnSDr1mCo4EG9,iv:287MEAzZFE3+zp3bWWA5Y2u3w7iQH+7AAZ812I4Elx0=,tag:TlljmsgLww7EJIBMdDrKvA==,type:str] TRUSTED_PROXIES: ENC[AES256_GCM,data:cAU=,iv:MBL/z8pmM2CxlDT1sY4my2gC3jsDo6O1NSa11w3en5U=,tag:zqzHOR69HT3+U7tQOFQQSw==,type:str] TZ: ENC[AES256_GCM,data:45gLKxH0OsAfMPkgnjKgWQ==,iv:P9CUovVI4WSfZi1nyFHVzHJ7Oioai1FUZRcgBNhQb64=,tag:S7IF8Oxg7hYNcT0mcgkg7Q==,type:str] + STATIC_CRON_TOKEN: ENC[AES256_GCM,data:1xck+8s3ifQmregeKU6891pErxZy86fO0I6XPE83l3o=,iv:XSsCSJkkGwG12f2lhd6IDl07OLVCW8J/945acFP99lA=,tag:XNxSQGyHvR/6/A3EVT69gg==,type:str] sops: kms: [] gcp_kms: [] azure_kv: [] hc_vault: [] age: [] - lastmodified: "2023-06-09T02:24:07Z" - mac: ENC[AES256_GCM,data:vH9g4Oua7GSJD8Ptzxg3wOz6Ytx6NoUeLZ3SOxeyFb01fVwNNg691tHQiHarEGGljCIzfSINn8GJ6ArpTQCGiBWFXXrO21owcmzgsQn3VfCDoKS3hEh4zFywwBNBGIOD/AphidmfU2Y8l7qNhY1O3p1Aq7o2xCxB+ee8q0TDw50=,iv:nPzm426vn/H+S9nI0Q83P6pNqpNyTJ/Gua0CdLx6tyk=,tag:PPe0DXa1Sb3KiqJBbyb+fQ==,type:str] + lastmodified: "2023-06-17T19:05:29Z" + mac: ENC[AES256_GCM,data:GWtQz5/wKpk38ZYLwn+kGyCT8hFo2SmoaI9vuEFju6N9ipJW1MNQONqTx/Qa8Cje8pT7xIxdoTf+23PaFG91v/gcilMCYjE+OFnVBk80d6ZBTXiSmoQ0DYO3hWiXyMfXTJ1OPqExOkY09QSAfXOrN0JphnWpPNZnaVuxMJZS/Og=,iv:/QbEi6hhsPpeSa5bOxPObP8UUpAwA/I6wU8VXQ6NcOc=,tag:FYYj1y/zTl82SVva0oauuA==,type:str] pgp: - created_at: "2023-04-22T06:45:59Z" enc: | diff --git a/cluster/apps/default/fireflyiii/kustomization.yaml b/cluster/apps/default/fireflyiii/kustomization.yaml index 8eb891c..fe2987e 100644 --- a/cluster/apps/default/fireflyiii/kustomization.yaml +++ b/cluster/apps/default/fireflyiii/kustomization.yaml @@ -2,4 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - ./env-secret.sops.yaml -- ./helm-release.yaml \ No newline at end of file +- ./helm-release.yaml +- ./daily-cronjob.yaml \ No newline at end of file