From 9847eac88d760cbc405fbb562cb8f4da30111f78 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Sun, 13 Oct 2024 18:53:00 -0400 Subject: [PATCH] feat(radarr): update folder structure, try to implement b2 backups --- kubernetes/common/templates/volsync/b2.yaml | 2 +- .../radarr/app/backup-creds.sops.yaml | 75 +++++++++++++++++++ .../radarr/{ => app}/helm-release.yaml | 20 ++--- .../download/radarr/app/kustomization.yaml | 7 ++ .../{ => app}/radarr-exportarr-metrics.yaml | 0 kubernetes/main/apps/download/radarr/ks.yaml | 28 +++++++ .../apps/download/radarr/kustomization.yaml | 5 -- 7 files changed, 122 insertions(+), 15 deletions(-) create mode 100644 kubernetes/main/apps/download/radarr/app/backup-creds.sops.yaml rename kubernetes/main/apps/download/radarr/{ => app}/helm-release.yaml (87%) create mode 100644 kubernetes/main/apps/download/radarr/app/kustomization.yaml rename kubernetes/main/apps/download/radarr/{ => app}/radarr-exportarr-metrics.yaml (100%) create mode 100644 kubernetes/main/apps/download/radarr/ks.yaml delete mode 100644 kubernetes/main/apps/download/radarr/kustomization.yaml diff --git a/kubernetes/common/templates/volsync/b2.yaml b/kubernetes/common/templates/volsync/b2.yaml index 201b3c8..5eb1f63 100644 --- a/kubernetes/common/templates/volsync/b2.yaml +++ b/kubernetes/common/templates/volsync/b2.yaml @@ -10,7 +10,7 @@ spec: restic: copyMethod: "${VOLSYNC_COPYMETHOD:-Snapshot}" pruneIntervalDays: 7 - repository: "${APP}-volsync-r2-secret" + repository: "${APP}-volsync-b2-secret" volumeSnapshotClassName: "${VOLSYNC_SNAPSHOTCLASS:-longhorn}" cacheCapacity: "${VOLSYNC_CACHE_CAPACITY:-4Gi}" cacheStorageClassName: "${VOLSYNC_CACHE_SNAPSHOTCLASS:-mainpool-hostpath}" diff --git a/kubernetes/main/apps/download/radarr/app/backup-creds.sops.yaml b/kubernetes/main/apps/download/radarr/app/backup-creds.sops.yaml new file mode 100644 index 0000000..bf40ad7 --- /dev/null +++ b/kubernetes/main/apps/download/radarr/app/backup-creds.sops.yaml @@ -0,0 +1,75 @@ +apiVersion: v1 +kind: Secret +metadata: + name: radarr-volsync-b2-secret + namespace: download +type: Opaque +stringData: + RESTIC_REPOSITORY: ENC[AES256_GCM,data:+veFT1W3b3seqmzYobKCeWbG6ENvg4Ldggq5Vr87x3l/IS+ZpNoUg4LvORbA4Bc=,iv:iNyL+43KLbTVcyyrHiZADht0/2e9xjlNmz6Su5alrsM=,tag:OzLJHB4JKZtudbF15SQqHg==,type:str] + RESTIC_PASSWORD: ENC[AES256_GCM,data:e1Ji5tLyO+D83LTrCX0Vn2ElbvZ5zjzwmfqukwhm4yI=,iv:s8MtgLlI4zw/tR9/BipWKSjJb3YkawNAoAfYTSnVssE=,tag:nRn5KViI/ap0NHQ/KbDZrQ==,type:str] + AWS_ACCESS_KEY_ID: ENC[AES256_GCM,data:HqlLzU1aRhxs6jPVFPJwC2VvJJKT2se0YQ==,iv:rxkIrlwPz+SpeJzySUqlac36H2UF4aXJPWOieStvVAA=,tag:piy0i2GJ27RdB52f1HN9Pw==,type:str] + AWS_SECRET_ACCESS_KEY: ENC[AES256_GCM,data:Sc8p4PCOtpedx4RCwiPBokMf6VZK2AIEhqlFWJLMxQ==,iv:WcSlztDPaJ74DOYvLNdMys8qvGcU75hB6ah75BwqS6I=,tag:clEW+2no+iyauPxA9Nogcw==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: [] + lastmodified: "2024-10-13T22:45:06Z" + mac: ENC[AES256_GCM,data:Ah819y/70by3PifAVnUxD4Fo0RDvSRB2z85zjmNJe2WMye4OLBY31kfdtG+ExM6wnO5SlRX8MVWxqMHRuR2wDdj1jZ0JauhVEOjffftQ1gVWZDoDPmQPYycDIk6/M+Go/1hh744CGACddxDeLGecnsgYqqXCEMUdOn9V8+7WZwk=,iv:FxVGayNbqsOC/CV0FuEnNhdpuOcUZ57BwqN0u/3KOW8=,tag:DsFqasdTw7yg8Ox2zSL9kw==,type:str]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/hvC+jRkSXHh5G9zcfeoKmH6rptzTw6N980sTv + PiyU8TSeccq0+tyz6ZlMmuGQeThTgTZ3Nwxo/JUGlDqw8DYm7ch0Q8EN1JN/rJM6 + wjxlBGZlH4jIhovSkwgv4X+spQB6kIsZR91M+ZECuvp5tlT5bfHXYkLw/wPilrCS + cVXBpIB9vr9fd6Rb2p8U/EJ+AV+fb1UsaBRVkPhDNgOGK7npYeyL8Aoc4IA0oQue + TyJKVyyueeUvIJ4X60ho/6DTqn7OIWw0frVshZ7cw73WbT1KSJQGFX+U+Q2Laxj/ + 1zUNyNi2bqHnIn81Yo7aqgiKxXJhUnmV2Ky1EbyZ2aZbjoWVmz2IwO2AJXIO1MpA + CjijpJBEI/w9Y54LtGxREZB4cRBB0wiJoXNcMMsQYOxVLQ6oyh0t5vQi5lY6DtRo + AQkCECjduK5Lcsdtn+uNenCrDoIArYdDaWyIitEP7MEzMOxTySNbFLrVB2ufovOc + ikh61nMtBjjw0cX+rNha1MDQRQxo7eakDhUm/1D3dOmUxoc2sJ/++kBl6qA9OnG/ + Wo1Ic6rcgl0= + =pHI2 + -----END PGP MESSAGE----- + fp: BD1AAF9D8170F4BEE437365FF6F0933799CFEBCD + - created_at: "2024-10-13T22:45:06Z" + enc: |- + -----BEGIN PGP MESSAGE----- + + hQIMAwAAAAAAAAAAAQ/9HbXhN5NSTcWa5g8C12QP1recnZryBwNh2AJdhRmdZS8R + SRZcBzhMm02zoToKSqjy4aYMIoJk6ZShVdtheh4uYxQXI8M6a/CTcurNot+taD96 + D8iK5GXsIM+mriorCZZhgJK0n9n3oUSp2kMSOyzXzm/Cl24yG+vvbEur3JOh4Tic + GogkE6oeyytf6/YeGYtgvRXbsaFD1tRoUrTvzeYkOPL+ii66CDIbVgzOsAyGbg/P + DSu0ME9TVCeg+8w0RP/TAnvnsmTP6Pt/fDl+QPJcm7ysqKWkrmxb3pxuIQ3p3Epf + qWKxkjqf0GOXf9rzArL1l4my/tzXJyiobuq2felSJUZ4KvWyqRSQeTWuncKQQhVT + xK2tBZQDzpRvXugZ1Pu9kTqhhFa9A3T5gR5NTbzyfQraMfzGAHO08vKOYPN/LMgi + 7hHfnP2tG++zKfvKhaAPMWvW/1TOzxgyHDDOjNwHRaXH4NuuYfEmy+vgcnq2Vohh + ej1q+ke5qSDuG6KMAkxq0PcUwD8H8zbJv7VR/QlnL51aauMIVCmqoUUd8i3SZhJV + 4gskUMjVvSYpq3tdOyAMwfP0c4BI0Ft7ldX7zithfGiNfCKngyrMXEzaRnKx95/n + p26pvJudVXBOt7T4MyFSYbH5rlqgnVLehFn/IJS4QUhgC8pAlcc0f2vLJUkZ9n/U + aAEJAhDnzLrepQGdEqdiLU4WtLUCd5VPGEk7ROuUe7H3N3f4x5bQHhhjJnNvdjf/ + DNZ0Jmc7glBUjp+hY8NfhkV2KcpDOmJ7OgSiS+fdAAsLyYuLoDupINpvKU8KHl3N + InfTWfiVu02S + =zhN+ + -----END PGP MESSAGE----- + fp: 687802D4DFD8AA82EA55666CF7DADAC782D7663D + encrypted_regex: ^(data|stringData)$ + version: 3.9.1 diff --git a/kubernetes/main/apps/download/radarr/helm-release.yaml b/kubernetes/main/apps/download/radarr/app/helm-release.yaml similarity index 87% rename from kubernetes/main/apps/download/radarr/helm-release.yaml rename to kubernetes/main/apps/download/radarr/app/helm-release.yaml index a31c5df..2853941 100644 --- a/kubernetes/main/apps/download/radarr/helm-release.yaml +++ b/kubernetes/main/apps/download/radarr/app/helm-release.yaml @@ -90,15 +90,17 @@ spec: persistence: config: - type: hostPath - hostPath: /mnt/MainPool/Kubernetes/radarr - advancedMounts: - main: # controller name - radarr: # container name - - path: /config - exportarr: - - path: /config - readOnly: true + #type: hostPath + #hostPath: /mnt/MainPool/Kubernetes/radarr + existingClaim: radarr + globalMounts: + - path: /config +# main: # controller name +# radarr: # container name +# - path: /config +# exportarr: +# - path: /config +# readOnly: true storage: type: hostPath hostPath: /mnt/MainPool/Media diff --git a/kubernetes/main/apps/download/radarr/app/kustomization.yaml b/kubernetes/main/apps/download/radarr/app/kustomization.yaml new file mode 100644 index 0000000..5f320e0 --- /dev/null +++ b/kubernetes/main/apps/download/radarr/app/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ./backup-creds.sops.yaml +- ./helm-release.yaml +- ./radarr-exportarr-metrics.yaml +- ../../../../common/templates/volsync \ No newline at end of file diff --git a/kubernetes/main/apps/download/radarr/radarr-exportarr-metrics.yaml b/kubernetes/main/apps/download/radarr/app/radarr-exportarr-metrics.yaml similarity index 100% rename from kubernetes/main/apps/download/radarr/radarr-exportarr-metrics.yaml rename to kubernetes/main/apps/download/radarr/app/radarr-exportarr-metrics.yaml diff --git a/kubernetes/main/apps/download/radarr/ks.yaml b/kubernetes/main/apps/download/radarr/ks.yaml new file mode 100644 index 0000000..d30a142 --- /dev/null +++ b/kubernetes/main/apps/download/radarr/ks.yaml @@ -0,0 +1,28 @@ +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app radarr + namespace: flux-system +spec: + timeout: 5m + interval: 10m + targetNamespace: download + path: ./kubernetes/main/apps/download/radarr/app + prune: true + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg + postBuild: + substituteFrom: + - kind: ConfigMap + name: cluster-settings + - kind: Secret + name: cluster-secrets + substitute: + APP: *app + VOLSYNC_CAPACITY: 15Gi \ No newline at end of file diff --git a/kubernetes/main/apps/download/radarr/kustomization.yaml b/kubernetes/main/apps/download/radarr/kustomization.yaml deleted file mode 100644 index 3f72535..0000000 --- a/kubernetes/main/apps/download/radarr/kustomization.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: -- ./helm-release.yaml -- ./radarr-exportarr-metrics.yaml \ No newline at end of file