From 0be2949c500c92be9d87720b953ebf9dc096cd70 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Fri, 26 Jan 2024 13:39:13 +0100 Subject: [PATCH] rework storage to reduce backup load --- loki/values.yaml | 9 ++++++++- longhorn/recurringjobs.yaml | 25 +++++++++++++++++++++++++ longhorn/storageclass.yaml | 15 +++++++++++++++ longhorn/values.yaml | 8 ++++++++ prometheus/values.yaml | 1 + 5 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 longhorn/recurringjobs.yaml create mode 100644 longhorn/storageclass.yaml diff --git a/loki/values.yaml b/loki/values.yaml index 1908c4b..bcefb77 100644 --- a/loki/values.yaml +++ b/loki/values.yaml @@ -4,6 +4,7 @@ minio: drivesPerNode: 2 persistence: size: 15Gi + storageClass: longhorn-local loki: auth_enabled: false persistence: @@ -11,4 +12,10 @@ loki: monitoring: selfMonitoring: grafanaAgent: - installOperator: false \ No newline at end of file + installOperator: false +write: + persistence: + storageClass: longhorn-local +backend: + persistence: + storageClass: longhorn-local diff --git a/longhorn/recurringjobs.yaml b/longhorn/recurringjobs.yaml new file mode 100644 index 0000000..ddcec2a --- /dev/null +++ b/longhorn/recurringjobs.yaml @@ -0,0 +1,25 @@ +apiVersion: longhorn.io/v1beta1 +kind: RecurringJob +metadata: + name: snapshot + namespace: longhorn-system +spec: + cron: "40 * * * *" + task: "snapshot" + groups: + - default + retain: 12 + concurrency: 2 +--- +apiVersion: longhorn.io/v1beta1 +kind: RecurringJob +metadata: + name: backup + namespace: longhorn-system +spec: + cron: "30 4 * * *" + task: "backup" + groups: + - default + retain: 7 + concurrency: 2 diff --git a/longhorn/storageclass.yaml b/longhorn/storageclass.yaml new file mode 100644 index 0000000..2ab4149 --- /dev/null +++ b/longhorn/storageclass.yaml @@ -0,0 +1,15 @@ +# this is the storageclass manifest for the logs and metrics volumes +kind: StorageClass + apiVersion: storage.k8s.io/v1 + metadata: + name: longhorn-local + provisioner: driver.longhorn.io + allowVolumeExpansion: true + reclaimPolicy: "Delete" + volumeBindingMode: Immediate + parameters: + numberOfReplicas: "2" + staleReplicaTimeout: "30" + fromBackup: "" + fsType: "ext4" + dataLocality: "disabled" \ No newline at end of file diff --git a/longhorn/values.yaml b/longhorn/values.yaml index 1745477..11b5eb3 100644 --- a/longhorn/values.yaml +++ b/longhorn/values.yaml @@ -1,3 +1,11 @@ +persistence: + recurringJobSelector: + enable: true + jobList: + - name: snapshot + isGroup: false + - name: backup + isGroup: false defaultSettings: defaultDataPath: /storage1 backupTarget: "s3://yolokube-backup@weur/" diff --git a/prometheus/values.yaml b/prometheus/values.yaml index d5dbed7..ee1a78e 100644 --- a/prometheus/values.yaml +++ b/prometheus/values.yaml @@ -117,6 +117,7 @@ prometheus: storageSpec: volumeClaimTemplate: spec: + storageClassName: longhorn-local accessModes: ["ReadWriteOnce"] resources: requests: