From 4f2159e410dbb7f95d4155ea2ef2816e5bd722de Mon Sep 17 00:00:00 2001 From: Jason Whitelock Date: Tue, 20 Jun 2023 22:44:37 +0100 Subject: [PATCH] all backups --- cluster/apps/default/actual/volsync.yaml | 4 +- cluster/apps/media/plex/kustomization.yaml | 1 + cluster/apps/media/plex/volsync.yaml | 41 +++++++++++++++++++ .../apps/media/tautulli/kustomization.yaml | 1 + cluster/apps/media/tautulli/volsync.yaml | 41 +++++++++++++++++++ .../apps/networking/omada/volsync-data.yaml | 4 +- .../apps/networking/omada/volsync-logs.yaml | 4 +- .../apps/networking/omada/volsync-work.yaml | 4 +- 8 files changed, 92 insertions(+), 8 deletions(-) create mode 100644 cluster/apps/media/plex/volsync.yaml create mode 100644 cluster/apps/media/tautulli/volsync.yaml diff --git a/cluster/apps/default/actual/volsync.yaml b/cluster/apps/default/actual/volsync.yaml index 006027eb..5a98c82b 100644 --- a/cluster/apps/default/actual/volsync.yaml +++ b/cluster/apps/default/actual/volsync.yaml @@ -4,7 +4,7 @@ apiVersion: volsync.backube/v1alpha1 kind: ReplicationSource metadata: name: actual - namespace: home + namespace: default spec: sourcePVC: actual-data-pvc trigger: @@ -29,7 +29,7 @@ apiVersion: v1 kind: Secret metadata: name: actual-restic-secret - namespace: home + namespace: default labels: app.kubernetes.io/name: actual type: Opaque diff --git a/cluster/apps/media/plex/kustomization.yaml b/cluster/apps/media/plex/kustomization.yaml index 34a8531c..fa36211c 100644 --- a/cluster/apps/media/plex/kustomization.yaml +++ b/cluster/apps/media/plex/kustomization.yaml @@ -2,3 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - helm-release.yaml + - volsync.yaml diff --git a/cluster/apps/media/plex/volsync.yaml b/cluster/apps/media/plex/volsync.yaml new file mode 100644 index 00000000..a59fdac7 --- /dev/null +++ b/cluster/apps/media/plex/volsync.yaml @@ -0,0 +1,41 @@ +--- +# yaml-language-server: $schema=https://schemas.budimanjojo.com/volsync.backube/replicationsource_v1alpha1.json +apiVersion: volsync.backube/v1alpha1 +kind: ReplicationSource +metadata: + name: plex + namespace: media +spec: + sourcePVC: plex-config-pvc + trigger: + schedule: 0 2 * * * + restic: + copyMethod: Snapshot + pruneIntervalDays: 7 + repository: plex-restic-secret + volumeSnapshotClassName: longhorn-snapshot-vsc + storageClassName: longhorn-static + moverSecurityContext: + runAsUser: 568 + runAsGroup: 568 + fsGroup: 568 + retain: + daily: 10 + within: 3d + +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.26.1-standalone-strict/secret-v1.json +apiVersion: v1 +kind: Secret +metadata: + name: plex-restic-secret + namespace: media + labels: + app.kubernetes.io/name: plex +type: Opaque +stringData: + RESTIC_REPOSITORY: ${SECRET_RESTIC_S3_REPO}/plex + RESTIC_PASSWORD: ${SECRET_RESTIC_PASSWORD} + AWS_ACCESS_KEY_ID: ${SECRET_RESTIC_S3_KEY} + AWS_SECRET_ACCESS_KEY: ${SECRET_RESTIC_S3_PASS} + RESTIC_PACK_SIZE: "60" diff --git a/cluster/apps/media/tautulli/kustomization.yaml b/cluster/apps/media/tautulli/kustomization.yaml index 34a8531c..fa36211c 100644 --- a/cluster/apps/media/tautulli/kustomization.yaml +++ b/cluster/apps/media/tautulli/kustomization.yaml @@ -2,3 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - helm-release.yaml + - volsync.yaml diff --git a/cluster/apps/media/tautulli/volsync.yaml b/cluster/apps/media/tautulli/volsync.yaml new file mode 100644 index 00000000..95522225 --- /dev/null +++ b/cluster/apps/media/tautulli/volsync.yaml @@ -0,0 +1,41 @@ +--- +# yaml-language-server: $schema=https://schemas.budimanjojo.com/volsync.backube/replicationsource_v1alpha1.json +apiVersion: volsync.backube/v1alpha1 +kind: ReplicationSource +metadata: + name: tautulli + namespace: media +spec: + sourcePVC: tautulli-config-pvc + trigger: + schedule: 0 2 * * * + restic: + copyMethod: Snapshot + pruneIntervalDays: 7 + repository: tautulli-restic-secret + volumeSnapshotClassName: longhorn-snapshot-vsc + storageClassName: longhorn-static + moverSecurityContext: + runAsUser: 568 + runAsGroup: 568 + fsGroup: 568 + retain: + daily: 10 + within: 3d + +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.26.1-standalone-strict/secret-v1.json +apiVersion: v1 +kind: Secret +metadata: + name: tautulli-restic-secret + namespace: media + labels: + app.kubernetes.io/name: tautulli +type: Opaque +stringData: + RESTIC_REPOSITORY: ${SECRET_RESTIC_S3_REPO}/tautulli + RESTIC_PASSWORD: ${SECRET_RESTIC_PASSWORD} + AWS_ACCESS_KEY_ID: ${SECRET_RESTIC_S3_KEY} + AWS_SECRET_ACCESS_KEY: ${SECRET_RESTIC_S3_PASS} + RESTIC_PACK_SIZE: "60" diff --git a/cluster/apps/networking/omada/volsync-data.yaml b/cluster/apps/networking/omada/volsync-data.yaml index 0f357632..7fa290ef 100644 --- a/cluster/apps/networking/omada/volsync-data.yaml +++ b/cluster/apps/networking/omada/volsync-data.yaml @@ -4,7 +4,7 @@ apiVersion: volsync.backube/v1alpha1 kind: ReplicationSource metadata: name: omada-data - namespace: home + namespace: networking spec: sourcePVC: omada-data-pvc trigger: @@ -29,7 +29,7 @@ apiVersion: v1 kind: Secret metadata: name: omada-data-restic-secret - namespace: home + namespace: networking type: Opaque stringData: RESTIC_REPOSITORY: ${SECRET_RESTIC_S3_REPO}/omada-data diff --git a/cluster/apps/networking/omada/volsync-logs.yaml b/cluster/apps/networking/omada/volsync-logs.yaml index 68cb1503..ed6eed71 100644 --- a/cluster/apps/networking/omada/volsync-logs.yaml +++ b/cluster/apps/networking/omada/volsync-logs.yaml @@ -4,7 +4,7 @@ apiVersion: volsync.backube/v1alpha1 kind: ReplicationSource metadata: name: omada-logs - namespace: home + namespace: networking spec: sourcePVC: omada-logs-pvc trigger: @@ -29,7 +29,7 @@ apiVersion: v1 kind: Secret metadata: name: omada-logs-restic-secret - namespace: home + namespace: networking type: Opaque stringData: RESTIC_REPOSITORY: ${SECRET_RESTIC_S3_REPO}/omada-logs diff --git a/cluster/apps/networking/omada/volsync-work.yaml b/cluster/apps/networking/omada/volsync-work.yaml index ffbc0f96..542226d5 100644 --- a/cluster/apps/networking/omada/volsync-work.yaml +++ b/cluster/apps/networking/omada/volsync-work.yaml @@ -4,7 +4,7 @@ apiVersion: volsync.backube/v1alpha1 kind: ReplicationSource metadata: name: omada-work - namespace: home + namespace: networking spec: sourcePVC: omada-work-pvc trigger: @@ -29,7 +29,7 @@ apiVersion: v1 kind: Secret metadata: name: omada-work-restic-secret - namespace: home + namespace: networking type: Opaque stringData: RESTIC_REPOSITORY: ${SECRET_RESTIC_S3_REPO}/omada-work