From 4122bd06038510dab49b910f65fcdc631b41da47 Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Thu, 10 Jul 2025 10:18:37 +1000 Subject: [PATCH] Rebase SABnzbd smb volumes --- services/PVR/SABnzbd/_namespace-sabnzbd.yaml | 4 +++ services/PVR/SABnzbd/application-sabnzbd.yaml | 18 ++++++++++ services/PVR/SABnzbd/deployment-sabnzbd.yaml | 16 ++++----- ...ingressroute-sabnzbd-apikey.sensitive.yaml | 16 +++++++++ .../PVR/SABnzbd/ingressroute-sabnzbd.yaml | 2 +- ...ersistentvolume-csismb-sabnzbd-config.yaml | 33 +++++++++++++++++++ ...rsistentvolume-csismb-sabnzbd-scratch.yaml | 33 +++++++++++++++++++ ...stentvolume-flexvolsmb-sabnzbd-config.yaml | 19 ----------- ...entvolumeclaim-csismb-sabnzbd-config.yaml} | 6 ++-- ...entvolumeclaim-csismb-sabnzbd-scratch.yaml | 12 +++++++ .../SABnzbd/sealedsecret-smb-credentials.yaml | 16 +++++++++ services/PVR/SABnzbd/service-sabnzbd.yaml | 2 +- 12 files changed, 145 insertions(+), 32 deletions(-) create mode 100644 services/PVR/SABnzbd/_namespace-sabnzbd.yaml create mode 100644 services/PVR/SABnzbd/application-sabnzbd.yaml create mode 100644 services/PVR/SABnzbd/ingressroute-sabnzbd-apikey.sensitive.yaml create mode 100644 services/PVR/SABnzbd/persistentvolume-csismb-sabnzbd-config.yaml create mode 100644 services/PVR/SABnzbd/persistentvolume-csismb-sabnzbd-scratch.yaml delete mode 100644 services/PVR/SABnzbd/persistentvolume-flexvolsmb-sabnzbd-config.yaml rename services/PVR/SABnzbd/{persistentvolumeclaim-flexvolsmb-sabnzbd-config.yaml => persistentvolumeclaim-csismb-sabnzbd-config.yaml} (59%) create mode 100644 services/PVR/SABnzbd/persistentvolumeclaim-csismb-sabnzbd-scratch.yaml create mode 100644 services/PVR/SABnzbd/sealedsecret-smb-credentials.yaml diff --git a/services/PVR/SABnzbd/_namespace-sabnzbd.yaml b/services/PVR/SABnzbd/_namespace-sabnzbd.yaml new file mode 100644 index 0000000..adc4047 --- /dev/null +++ b/services/PVR/SABnzbd/_namespace-sabnzbd.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: sabnzbd diff --git a/services/PVR/SABnzbd/application-sabnzbd.yaml b/services/PVR/SABnzbd/application-sabnzbd.yaml new file mode 100644 index 0000000..a62b68f --- /dev/null +++ b/services/PVR/SABnzbd/application-sabnzbd.yaml @@ -0,0 +1,18 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: sabnzbd + namespace: argo-cd +spec: + destination: + namespace: sabnzbd + server: https://kubernetes.default.svc + project: default + syncPolicy: + automated: {} + syncOptions: + - CreateNamespace=true + sources: + - repoURL: https://code.spamasaurus.com/djpbessems/Kubernetes.K3s.installLog + path: services/PVR/SABnzbd + targetRevision: HEAD diff --git a/services/PVR/SABnzbd/deployment-sabnzbd.yaml b/services/PVR/SABnzbd/deployment-sabnzbd.yaml index be41ecc..35b346c 100644 --- a/services/PVR/SABnzbd/deployment-sabnzbd.yaml +++ b/services/PVR/SABnzbd/deployment-sabnzbd.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: sabnzbd - namespace: pvr + namespace: sabnzbd labels: app: sabnzbd spec: @@ -25,17 +25,17 @@ spec: volumeMounts: - mountPath: /config/sabnzbd.ini subPath: sabnzbd.ini - name: flexvolsmb-sabnzbd-config + name: csismb-sabnzbd-config - mountPath: /downloads subPath: downloads - name: smb-pvr-volatile + name: csismb-sabnzbd-scratch - mountPath: /incomplete-downloads subPath: incomplete-downloads - name: smb-pvr-volatile + name: csismb-sabnzbd-scratch volumes: - - name: flexvolsmb-sabnzbd-config + - name: csismb-sabnzbd-config persistentVolumeClaim: - claimName: flexvolsmb-sabnzbd-config - - name: smb-pvr-volatile + claimName: csismb-sabnzbd-config + - name: csismb-sabnzbd-scratch persistentVolumeClaim: - claimName: smb-pvr-volatile + claimName: csismb-sabnzbd-scratch diff --git a/services/PVR/SABnzbd/ingressroute-sabnzbd-apikey.sensitive.yaml b/services/PVR/SABnzbd/ingressroute-sabnzbd-apikey.sensitive.yaml new file mode 100644 index 0000000..e1d8ef8 --- /dev/null +++ b/services/PVR/SABnzbd/ingressroute-sabnzbd-apikey.sensitive.yaml @@ -0,0 +1,16 @@ +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: sabnzbd-apikey + namespace: sabnzbd +spec: + entryPoints: + - websecure + routes: + - match: Host(`download.pvr.spamasaurus.com`) && (Header(`X-Api-Key`, `5bebd6163f521cd7f4aa2e6c1cc8f9f2`) || Query(`apikey`, `5bebd6163f521cd7f4aa2e6c1cc8f9f2`)) + kind: Rule + services: + - name: sabnzbd + port: 8080 + middlewares: + - name: security-headers@file diff --git a/services/PVR/SABnzbd/ingressroute-sabnzbd.yaml b/services/PVR/SABnzbd/ingressroute-sabnzbd.yaml index 9d09bd2..21061de 100644 --- a/services/PVR/SABnzbd/ingressroute-sabnzbd.yaml +++ b/services/PVR/SABnzbd/ingressroute-sabnzbd.yaml @@ -2,7 +2,7 @@ apiVersion: traefik.io/v1alpha1 kind: IngressRoute metadata: name: sabnzbd - namespace: pvr + namespace: sabnzbd spec: entryPoints: - websecure diff --git a/services/PVR/SABnzbd/persistentvolume-csismb-sabnzbd-config.yaml b/services/PVR/SABnzbd/persistentvolume-csismb-sabnzbd-config.yaml new file mode 100644 index 0000000..7b13b62 --- /dev/null +++ b/services/PVR/SABnzbd/persistentvolume-csismb-sabnzbd-config.yaml @@ -0,0 +1,33 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + annotations: + pv.kubernetes.io/provisioned-by: smb.csi.k8s.io + name: csismb-sabnzbd-config +spec: + capacity: + storage: 1Gi + accessModes: + - ReadWriteMany + persistentVolumeReclaimPolicy: Retain + storageClassName: csismb-sabnzbd-config + mountOptions: + - dir_mode=0777 + - file_mode=0777 + - uid=911 + - gid=911 + - nobrl + - cache=none + - mfsymlinks + - noserverino # required to prevent data corruption + csi: + driver: smb.csi.k8s.io + # volumeHandle format: {smb-server-address}#{sub-dir-name}#{share-name} + # make sure this value is unique for every share in the cluster + volumeHandle: 192.168.154.195#sabnzbd#config + volumeAttributes: + source: //192.168.154.195/K3s.Volumes + subDir: sabnzbd/config + nodeStageSecretRef: + name: smb-credentials + namespace: sonarr diff --git a/services/PVR/SABnzbd/persistentvolume-csismb-sabnzbd-scratch.yaml b/services/PVR/SABnzbd/persistentvolume-csismb-sabnzbd-scratch.yaml new file mode 100644 index 0000000..a8ac833 --- /dev/null +++ b/services/PVR/SABnzbd/persistentvolume-csismb-sabnzbd-scratch.yaml @@ -0,0 +1,33 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + annotations: + pv.kubernetes.io/provisioned-by: smb.csi.k8s.io + name: csismb-sabnzbd-scratch +spec: + capacity: + storage: 1Gi + accessModes: + - ReadWriteMany + persistentVolumeReclaimPolicy: Retain + storageClassName: csismb-sabnzbd-scratch + mountOptions: + - dir_mode=0777 + - file_mode=0777 + - uid=911 + - gid=911 + - nobrl + - cache=none + - mfsymlinks + - noserverino # required to prevent data corruption + csi: + driver: smb.csi.k8s.io + # volumeHandle format: {smb-server-address}#{sub-dir-name}#{share-name} + # make sure this value is unique for every share in the cluster + volumeHandle: 192.168.154.195#sabnzbd#scratch + volumeAttributes: + source: //192.168.154.195/K3s.Volumes + subDir: pvr/scratch + nodeStageSecretRef: + name: smb-credentials + namespace: sonarr diff --git a/services/PVR/SABnzbd/persistentvolume-flexvolsmb-sabnzbd-config.yaml b/services/PVR/SABnzbd/persistentvolume-flexvolsmb-sabnzbd-config.yaml deleted file mode 100644 index 05b3de3..0000000 --- a/services/PVR/SABnzbd/persistentvolume-flexvolsmb-sabnzbd-config.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: flexvolsmb-sabnzbd-config - namespace: pvr -spec: - capacity: - storage: 1Gi - accessModes: - - ReadWriteMany - storageClassName: flexvolsmb-sabnzbd-config - flexVolume: - driver: mount/smb - secretRef: - name: flexvolsmb-credentials - options: - opts: file_mode=0777,dir_mode=0777,uid=911,gid=911,iocharset=utf8 - server: 192.168.154.195 - share: /K3s.Volumes/sabnzbd/config diff --git a/services/PVR/SABnzbd/persistentvolumeclaim-flexvolsmb-sabnzbd-config.yaml b/services/PVR/SABnzbd/persistentvolumeclaim-csismb-sabnzbd-config.yaml similarity index 59% rename from services/PVR/SABnzbd/persistentvolumeclaim-flexvolsmb-sabnzbd-config.yaml rename to services/PVR/SABnzbd/persistentvolumeclaim-csismb-sabnzbd-config.yaml index 00eac4d..0219c28 100644 --- a/services/PVR/SABnzbd/persistentvolumeclaim-flexvolsmb-sabnzbd-config.yaml +++ b/services/PVR/SABnzbd/persistentvolumeclaim-csismb-sabnzbd-config.yaml @@ -1,12 +1,12 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: flexvolsmb-sabnzbd-config - namespace: pvr + name: csismb-sabnzbd-config + namespace: sabnzbd spec: accessModes: - ReadWriteMany - storageClassName: flexvolsmb-sabnzbd-config + storageClassName: csismb-sabnzbd-config resources: requests: storage: 1Gi diff --git a/services/PVR/SABnzbd/persistentvolumeclaim-csismb-sabnzbd-scratch.yaml b/services/PVR/SABnzbd/persistentvolumeclaim-csismb-sabnzbd-scratch.yaml new file mode 100644 index 0000000..a64177f --- /dev/null +++ b/services/PVR/SABnzbd/persistentvolumeclaim-csismb-sabnzbd-scratch.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: csismb-sabnzbd-scratch + namespace: sabnzbd +spec: + accessModes: + - ReadWriteMany + storageClassName: csismb-sabnzbd-scratch + resources: + requests: + storage: 1Gi diff --git a/services/PVR/SABnzbd/sealedsecret-smb-credentials.yaml b/services/PVR/SABnzbd/sealedsecret-smb-credentials.yaml new file mode 100644 index 0000000..5c26f35 --- /dev/null +++ b/services/PVR/SABnzbd/sealedsecret-smb-credentials.yaml @@ -0,0 +1,16 @@ +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + creationTimestamp: null + name: smb-credentials + namespace: sabznbd +spec: + encryptedData: + password: AgApEbfCfWiIHvJbn1pp9hgSYP9GrqY12T5v1Oa56AxurwyBtJkpowx0v6AnC6Ik8kXDUvJor0enXP/8wDICQpP+ly8qD9+dNj23OfpmRYSH6VZ4sRJt3rKeWnWGLNxrNOLLnwrovhkV4P1Yati6PVdwUb7db4kiFZ3s8yA1BqzSlLZ/1aBkd6StgBc3YgCQ8N6SsvhZ7bnmNTi2NxAmVVHsPE/o7xoRqK89gJB5CbXJyQ7GenFqDYL/ZpPJDaswP25AZwhOL3O6Af6djFOBgWa9tSYyQ115lnXpQqWBCU8q+Hzb1ZKDzpD5Dx2KmtcHrIzOEmQOYM159tNNZTRO9vuIc7nDeZKOc6MSVLDayohbSuxeThFPwTTh0Yvxi9ZBE0MUL0QwsJIZsHFHh+Mr+75Vj+u/Ec+Abc7bOo7hvX59i+ENHOuLG31RbaFbKmc7wSdbMitxlgwa1eGfEpTjbwvgUvXL2nWOVYxQrwJa0cAVnouy0sBGnyWy9O4NRVDAo0vhTGqjS4vhXp+zNEi1+O01CwZaZbcsKu3yMjXR8e/So9lB0WJoqHpPhz/ghDecu1mOH5JZnqHt+CpaliTKjOGD3NRDBJEYiSDWat9a9iMUWclV/hkmvyTGgmc0VcPO8Pe2pKWEExSzAUFS2qM5dmUcigPtaK5l0qunn8J7QTm4dnHv+B1KLt9jlDkboC3p1Ute8/FfGGJ5ILO5/SgDgl9G + username: AgAsKRJKPUgPbQ91tC5hV7E+QzRWAcn7UUNtH8WhQ1suZOiMRWxPLI9ISh808qmLqcS6MbC4cLzJg8HQ6VqV0YajpzSQbG2NATZ16dBl6zDoyY2DviiJ5xZlegrKlGXwnklmovoVXJFDJlxTkKAY1CZpEF13YXnKHBDpgB+V2eQnvYVYCxolO7vft21TAbRS6RyKYaxPVNaRKPAf2n6OSahkagt0YMeIw7f+pMeJ9KGv6fzYvy3mQoDfLuTEqYxQ+uxct6PWi8c/wskf2Cdf6I7yFxnYR5oJVM5WjYHx97FT6kU56m1+KUQr/+ZFERzFVmLwW2ePgomNS+ZJPPdr2HG7BvA0xP0wcmfIy/xTEgYBME2i9NARJ/0yPT5O8JAK5d/5rmMA7NXoc/koOcTTOXgFoEOmZZ+/ZHwkZblTVHl+zO+mnQBHzTYnJwnEMOC4YWJkMvyKiNwj9ENBN2p8aQPkBA0qpKY9D69NOT3un1SWpLyr0w4KfOzox+v+dUz+Om5xy20jXwOEpCCibu3+dbBdL3P8S/x3qeRfwyVR6U9jiiDrj4femXuRe4qfthweQOcl8nLJeVdNFRJScXjM+Ffr7957xh1tE1kOC3haQGR9Sfsq3FPGroGQ076PYVVTRfkH3dt79tqhk2mFnLiYxfrZv39cO4BvcRZR/DQzjXWtQRB+JHEU9dT8CfXgk3MYu6deqf8MdA4= + template: + metadata: + creationTimestamp: null + name: smb-credentials + namespace: sabznbd + type: Opaque diff --git a/services/PVR/SABnzbd/service-sabnzbd.yaml b/services/PVR/SABnzbd/service-sabnzbd.yaml index 8d8e1c4..59d5927 100644 --- a/services/PVR/SABnzbd/service-sabnzbd.yaml +++ b/services/PVR/SABnzbd/service-sabnzbd.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: sabnzbd - namespace: pvr + namespace: sabnzbd spec: ports: - protocol: TCP