From 75f07226aa7bd638c393c2795a025e780cd04687 Mon Sep 17 00:00:00 2001 From: Michael Thomson Date: Tue, 10 Jun 2025 10:07:18 -0400 Subject: [PATCH] longhorn recurring job CRDs --- .../longhorn/recurring-job-backup.yaml | 12 +++++++++++ .../longhorn/recurring-job-snapshot.yaml | 12 +++++++++++ .../configs/longhorn/recurring-job-trim.yaml | 12 +++++++++++ .../controllers/longhorn/release.yaml | 20 ++++++++++++++----- 4 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 infrastructure/configs/longhorn/recurring-job-backup.yaml create mode 100644 infrastructure/configs/longhorn/recurring-job-snapshot.yaml create mode 100644 infrastructure/configs/longhorn/recurring-job-trim.yaml diff --git a/infrastructure/configs/longhorn/recurring-job-backup.yaml b/infrastructure/configs/longhorn/recurring-job-backup.yaml new file mode 100644 index 0000000..a3a571e --- /dev/null +++ b/infrastructure/configs/longhorn/recurring-job-backup.yaml @@ -0,0 +1,12 @@ +apiVersion: longhorn.io/v1beta2 +kind: RecurringJob +metadata: + name: backup + namespace: longhorn-system +spec: + cron: "0 1 * * *" + task: "backup" + groups: + - backup + retain: 10 + concurrency: 1 diff --git a/infrastructure/configs/longhorn/recurring-job-snapshot.yaml b/infrastructure/configs/longhorn/recurring-job-snapshot.yaml new file mode 100644 index 0000000..52f3d28 --- /dev/null +++ b/infrastructure/configs/longhorn/recurring-job-snapshot.yaml @@ -0,0 +1,12 @@ +apiVersion: longhorn.io/v1beta2 +kind: RecurringJob +metadata: + name: snapshot + namespace: longhorn-system +spec: + cron: "0 * * * *" + task: "snapshot" + groups: + - snapshot + retain: 24 + concurrency: 2 diff --git a/infrastructure/configs/longhorn/recurring-job-trim.yaml b/infrastructure/configs/longhorn/recurring-job-trim.yaml new file mode 100644 index 0000000..6348f40 --- /dev/null +++ b/infrastructure/configs/longhorn/recurring-job-trim.yaml @@ -0,0 +1,12 @@ +apiVersion: longhorn.io/v1beta2 +kind: RecurringJob +metadata: + name: trim + namespace: longhorn-system +spec: + cron: "30 0 * * *" + task: "filesystem-trim" + groups: + - trim + retain: 0 + concurrency: 1 diff --git a/infrastructure/controllers/longhorn/release.yaml b/infrastructure/controllers/longhorn/release.yaml index 50d4ec8..f754885 100644 --- a/infrastructure/controllers/longhorn/release.yaml +++ b/infrastructure/controllers/longhorn/release.yaml @@ -18,11 +18,21 @@ spec: defaultClassReplicaCount: 3 recurringJobSelector: enable: true - jobList: [ - {"name":"backup", "isGroup":true}, - {"name":"snapshot", "isGroup":true}, - {"name":"trim", "isGroup":true}, - ] + jobList: | + [ + { + "name":"backup", + "isGroup":true + }, + { + "name":"snapshot", + "isGroup":true + } + { + "name":"trim", + "isGroup":true + } + ] defaultSettings: backupTarget: s3://mthomson-longhorn-backups@us-west-004/