From 9b38922fba013285438ddfc1e0e22187379679d5 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Fri, 23 Feb 2024 11:39:20 +0100 Subject: [PATCH] initial commit --- .gitignore | 1 + README.md | 3 ++ base/grafana-backuper.yaml | 59 ++++++++++++++++++++++++++++++++++++++ base/kustomization.yaml | 4 +++ overlay/kustomization.yaml | 9 ++++++ 5 files changed, 76 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 base/grafana-backuper.yaml create mode 100644 base/kustomization.yaml create mode 100644 overlay/kustomization.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6a3e68d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +**/.DS_Store \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..fd0d0a6 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Deployment repo for grafana-backuper. + +[![App Status](https://argo.services.yolokube.de/api/badge?name=grafana-backuper)](https://argo.services.yolokube.de/applications/grafana-backuper) \ No newline at end of file diff --git a/base/grafana-backuper.yaml b/base/grafana-backuper.yaml new file mode 100644 index 0000000..7456d78 --- /dev/null +++ b/base/grafana-backuper.yaml @@ -0,0 +1,59 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: grafana-backuper +--- +apiVersion: batch/v1 +kind: CronJob +metadata: + name: grafana-backuper + namespace: grafana-backuper +spec: + schedule: "0 * * * *" + successfulJobsHistoryLimit: 1 + failedJobsHistoryLimit: 3 + jobTemplate: + spec: + ttlSecondsAfterFinished: 1800 + template: + spec: + containers: + - name: grafana-backuper + image: git.ar21.de/yolokube/grafana-backuper:latest + env: + - name: GRAFANA_URL + value: "http://prometheus-grafana.prometheus" + - name: GRAFANA_AUTH_TOKEN + valueFrom: + secretKeyRef: + name: grafana-secrets + key: grafana-auth-token + - name: GIT_REPO_URL + value: "https://git.ar21.de/yolokube/grafana-dashboards.git" + - name: GIT_USER + valueFrom: + secretKeyRef: + name: git-secrets + key: git-user + - name: GIT_EMAIL + valueFrom: + secretKeyRef: + name: git-secrets + key: git-email + - name: GIT_PASS + valueFrom: + secretKeyRef: + name: git-secrets + key: git-pass + - name: GIT_SIGNING_KEY + value: /app/keys/signing-key.asc + volumeMounts: + - name: key-volume + mountPath: /app/keys + imagePullPolicy: IfNotPresent + volumes: + - name: key-volume + secret: + secretName: gpg-key + restartPolicy: Never \ No newline at end of file diff --git a/base/kustomization.yaml b/base/kustomization.yaml new file mode 100644 index 0000000..a1416e9 --- /dev/null +++ b/base/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- grafana-backuper.yaml \ No newline at end of file diff --git a/overlay/kustomization.yaml b/overlay/kustomization.yaml new file mode 100644 index 0000000..ed35306 --- /dev/null +++ b/overlay/kustomization.yaml @@ -0,0 +1,9 @@ +resources: +- ../base +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +images: +- name: git.ar21.de/yolokube/grafana-backuper + newName: git.ar21.de/yolokube/grafana-backuper + newTag: "latest" +namespace: grafana-backuper \ No newline at end of file