feat: Add longhorn backup job

This commit is contained in:
2025-12-13 02:13:44 +01:00
parent fbc08ff09c
commit 7b76a79262
7 changed files with 64 additions and 0 deletions

View File

@@ -14,3 +14,4 @@ resources:
- ../../configs/letsencrypt/letsencrypt.yaml
- ../../configs/certificates/certificates.yaml
- ../../configs/telegram-alerts/telegram-alerts.yaml
- ../../configs/longhorn-jobs/longhorn-jobs.yaml

View File

@@ -24,3 +24,8 @@ spec:
copy:
- from: "@foundation/configs/telegram-alerts/**"
to: "@artifact/"
- name: longhorn-jobs
originRevision: "@foundation"
copy:
- from: "@foundation/configs/longhorn-jobs/**"
to: "@artifact/"

View File

@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- recurring-job-backup.yaml
- recurring-job-snapshot.yaml
- recurring-job-snapshot-delete.yaml

View File

@@ -0,0 +1,16 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: longhorn-jobs
namespace: flux-system
spec:
interval: 1h
retryInterval: 2m
timeout: 5m
dependsOn:
- name: longhorn
sourceRef:
kind: ExternalArtifact
name: longhorn-jobs
prune: true
wait: true

View File

@@ -0,0 +1,12 @@
apiVersion: longhorn.io/v1beta2
kind: RecurringJob
metadata:
name: backup
namespace: longhorn-system
spec:
cron: "*/5 * * * *"
task: "backup"
retain: 5
concurrency: 2
groups:
- default

View File

@@ -0,0 +1,12 @@
apiVersion: longhorn.io/v1beta2
kind: RecurringJob
metadata:
name: backup
namespace: longhorn-system
spec:
cron: "2/5 * * * *"
task: "snapshot-delete"
retain: 5
concurrency: 2
groups:
- default

View File

@@ -0,0 +1,12 @@
apiVersion: longhorn.io/v1beta2
kind: RecurringJob
metadata:
name: backup
namespace: longhorn-system
spec:
cron: "1/5 * * * *"
task: "snapshot"
retain: 5
concurrency: 2
groups:
- default