diff --git a/services/audiobookshelf/audiobookshelf-deployment.yaml b/services/audiobookshelf/audiobookshelf-deployment.yaml index 0ab884e..f27d2fe 100644 --- a/services/audiobookshelf/audiobookshelf-deployment.yaml +++ b/services/audiobookshelf/audiobookshelf-deployment.yaml @@ -57,33 +57,3 @@ spec: - name: audiobookshelf-metadata persistentVolumeClaim: claimName: audiobookshelf-metadata-pvc ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: audiobookshelf-config-pvc - labels: - recurring-job.longhorn.io/source: "enabled" - recurring-job-group.longhorn.io/app-config-group: "enabled" -spec: - accessModes: - - ReadWriteOnce - storageClassName: longhorn - resources: - requests: - storage: 3Mi ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: audiobookshelf-metadata-pvc - labels: - recurring-job.longhorn.io/source: "enabled" - recurring-job-group.longhorn.io/app-config-group: "enabled" -spec: - accessModes: - - ReadWriteOnce - storageClassName: longhorn - resources: - requests: - storage: 10Mi diff --git a/services/audiobookshelf/audiobookshelf-pvcs.yaml b/services/audiobookshelf/audiobookshelf-pvcs.yaml new file mode 100644 index 0000000..1f10991 --- /dev/null +++ b/services/audiobookshelf/audiobookshelf-pvcs.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: audiobookshelf-config-pvc + labels: + recurring-job.longhorn.io/source: "enabled" + recurring-job-group.longhorn.io/app-config-group: "enabled" +spec: + accessModes: + - ReadWriteOnce + storageClassName: longhorn + resources: + requests: + storage: 100Mi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: audiobookshelf-metadata-pvc + labels: + recurring-job.longhorn.io/source: "enabled" + recurring-job-group.longhorn.io/app-config-group: "enabled" +spec: + accessModes: + - ReadWriteOnce + storageClassName: longhorn + resources: + requests: + storage: 1Gi diff --git a/services/calibre-web/calibre-web-deployment.yaml b/services/calibre-web/calibre-web-deployment.yaml index e80f172..b5c248e 100644 --- a/services/calibre-web/calibre-web-deployment.yaml +++ b/services/calibre-web/calibre-web-deployment.yaml @@ -44,8 +44,10 @@ spec: volumeMounts: - mountPath: /config name: calibre-web-config - - mountPath: /calibre-library + - mountPath: /calibre-library # The calibre-managed directories name: calibre-web-library + - mountPath: /cwa-book-ingest # Watched by calibre for ingest into calibre-library + name: calibre-ingest-dir restartPolicy: Always volumes: - name: calibre-web-config @@ -55,3 +57,7 @@ spec: nfs: server: robin.home.nest path: /yarr/media/books/calibre-library + - name: calibre-ingest-dir + nfs: + server: robin.home.nest + path: /yarr/media/books/calibre-ingest diff --git a/services/calibre-web/calibre-web-pvc.yaml b/services/calibre-web/calibre-web-pvcs.yaml similarity index 93% rename from services/calibre-web/calibre-web-pvc.yaml rename to services/calibre-web/calibre-web-pvcs.yaml index ae5f117..55a994a 100644 --- a/services/calibre-web/calibre-web-pvc.yaml +++ b/services/calibre-web/calibre-web-pvcs.yaml @@ -11,4 +11,4 @@ spec: storageClassName: longhorn resources: requests: - storage: 20Mi + storage: 5Gi diff --git a/services/lazy-librarian/lazylibrarian-deployment.yaml b/services/lazy-librarian/lazylibrarian-deployment.yaml deleted file mode 100644 index b5a3fef..0000000 --- a/services/lazy-librarian/lazylibrarian-deployment.yaml +++ /dev/null @@ -1,75 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f compose-ll.yaml - kompose.version: 1.38.0 (HEAD) - labels: - io.kompose.service: lazylibrarian - name: lazylibrarian -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: lazylibrarian - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f compose-ll.yaml - kompose.version: 1.38.0 (HEAD) - labels: - io.kompose.service: lazylibrarian - spec: - containers: - - env: - - name: DOCKER_MODS - value: linuxserver/mods:universal-calibre|linuxserver/mods:lazylibrarian-ffmpeg - - name: PGID - value: "1000" - - name: PUID - value: "1000" - - name: TZ - value: America/New_York - image: lscr.io/linuxserver/lazylibrarian:latest - name: lazylibrarian - ports: - - containerPort: 5299 - protocol: TCP - name: web-ui - volumeMounts: - - mountPath: /config - name: lazylibrarian-config - - mountPath: /downloads - name: lazylibrarian-downloads - - mountPath: /data - name: lazylibrarian-data - restartPolicy: Always - volumes: - - name: lazylibrarian-config - persistentVolumeClaim: - claimName: lazylibrarian-config-pvc - - name: lazylibrarian-downloads - nfs: - server: robin.home.nest - path: /yarr/downloads - - name: lazylibrarian-data - nfs: - server: robin.home.nest - path: /yarr ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: lazylibrarian-config-pvc - labels: - recurring-job.longhorn.io/source: "enabled" - recurring-job-group.longhorn.io/app-config-group: "enabled" -spec: - accessModes: - - ReadWriteOnce - storageClassName: longhorn - resources: - requests: - storage: 4Gi diff --git a/services/lazy-librarian/lazylibrarian-ingress.yaml b/services/lazy-librarian/lazylibrarian-ingress.yaml deleted file mode 100644 index 2c15996..0000000 --- a/services/lazy-librarian/lazylibrarian-ingress.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: lazy-librarian-ingress - namespace: default - annotations: - traefik.ingress.kubernetes.io/router.entrypoints: web -spec: - rules: - - host: lazy-librarian.k3s.home.nest - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: lazylibrarian - port: - name: http-web diff --git a/services/lazy-librarian/lazylibrarian-service.yaml b/services/lazy-librarian/lazylibrarian-service.yaml deleted file mode 100644 index d0b9c67..0000000 --- a/services/lazy-librarian/lazylibrarian-service.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - annotations: - kompose.cmd: kompose convert -f compose-ll.yaml - kompose.version: 1.38.0 (HEAD) - labels: - io.kompose.service: lazylibrarian - name: lazylibrarian -spec: - type: ClusterIP - ports: - - name: http-web - port: 80 - targetPort: web-ui - selector: - io.kompose.service: lazylibrarian diff --git a/services/lidarr/lidarr-deployment.yaml b/services/lidarr/lidarr-deployment.yaml index b6cf3d3..fc54f32 100644 --- a/services/lidarr/lidarr-deployment.yaml +++ b/services/lidarr/lidarr-deployment.yaml @@ -1,26 +1,20 @@ apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.cmd: kompose convert -f compose-yarr.yaml - kompose.version: 1.38.0 (HEAD) labels: - io.kompose.service: lidarr + app: lidarr name: lidarr spec: replicas: 1 selector: matchLabels: - io.kompose.service: lidarr + app: lidarr strategy: type: Recreate template: metadata: - annotations: - kompose.cmd: kompose convert -f compose-yarr.yaml - kompose.version: 1.38.0 (HEAD) labels: - io.kompose.service: lidarr + app: lidarr spec: containers: - env: @@ -32,6 +26,11 @@ spec: value: America/New_York - name: WEBUI_PORTS value: 8686/tcp + - name: DOCKER_MODS + value: "linuxserver/mods:lidarr-flac2mp3" + # Instruct FFmpeg to build Opus at a transparent 160kbps VBR rate + - name: FLAC2MP3_ARGS + value: "-a '-acodec libopus -ac 2 -ab 160k' -e .opus" image: lscr.io/linuxserver/lidarr:nightly name: lidarr ports: @@ -58,18 +57,3 @@ spec: nfs: server: robin.home.nest path: /yarr/downloads ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: lidarr-config-pvc - labels: - recurring-job.longhorn.io/source: "enabled" - recurring-job-group.longhorn.io/app-config-group: "enabled" -spec: - accessModes: - - ReadWriteOnce - storageClassName: longhorn - resources: - requests: - storage: 1Gi diff --git a/services/lidarr/lidarr-pvcs.yaml b/services/lidarr/lidarr-pvcs.yaml new file mode 100644 index 0000000..ef415b4 --- /dev/null +++ b/services/lidarr/lidarr-pvcs.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: lidarr-config-pvc + labels: + recurring-job.longhorn.io/source: "enabled" + recurring-job-group.longhorn.io/app-config-group: "enabled" +spec: + accessModes: + - ReadWriteOnce + storageClassName: longhorn + resources: + requests: + storage: 1Gi + diff --git a/services/lidarr/lidarr-service.yaml b/services/lidarr/lidarr-service.yaml index 1a842df..4717b01 100644 --- a/services/lidarr/lidarr-service.yaml +++ b/services/lidarr/lidarr-service.yaml @@ -1,4 +1,3 @@ ---- apiVersion: v1 kind: Service metadata: @@ -11,4 +10,4 @@ spec: port: 80 targetPort: lidarr-ui selector: - io.kompose.service: lidarr + app: lidarr diff --git a/services/navidrome/navidrome-deployment.yaml b/services/navidrome/navidrome-deployment.yaml index e70e642..b927461 100644 --- a/services/navidrome/navidrome-deployment.yaml +++ b/services/navidrome/navidrome-deployment.yaml @@ -54,18 +54,3 @@ spec: nfs: server: robin.home.nest path: /yarr/media/music ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: navidrome-config-pvc - labels: - recurring-job.longhorn.io/source: "enabled" - recurring-job-group.longhorn.io/app-config-group: "enabled" -spec: - accessModes: - - ReadWriteOnce - storageClassName: longhorn - resources: - requests: - storage: 1Gi diff --git a/services/navidrome/navidrome-pvcs.yaml b/services/navidrome/navidrome-pvcs.yaml new file mode 100644 index 0000000..3570d14 --- /dev/null +++ b/services/navidrome/navidrome-pvcs.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: navidrome-config-pvc + labels: + recurring-job.longhorn.io/source: "enabled" + recurring-job-group.longhorn.io/app-config-group: "enabled" +spec: + accessModes: + - ReadWriteOnce + storageClassName: longhorn + resources: + requests: + storage: 2Gi diff --git a/services/readmeabook/readmeabook-cron-jobs.yaml b/services/readmeabook/readmeabook-cron-jobs.yaml new file mode 100644 index 0000000..908ac8e --- /dev/null +++ b/services/readmeabook/readmeabook-cron-jobs.yaml @@ -0,0 +1,60 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: media-hardlink-router + namespace: default +spec: + schedule: "*/5 * * * *" + concurrencyPolicy: Forbid + jobTemplate: + spec: + template: + spec: + containers: + - name: hardlink-router + image: alpine:latest + command: + - /bin/sh + - -c + - | + echo "Starting companion ebook routing..." + + # Paths mapped entirely within the clean media tree + AUDIO_DIR="/yarr/media/audiobooks" + BOOK_INGEST="/yarr/media/books/calibre-ingest" + LOG_FILE="/yarr/media/books/.calibre_sidecars_linked.log" + + touch "$LOG_FILE" + + # Scan pristine audiobook folders for companion ebooks + if [ -d "$AUDIO_DIR" ]; then + find "$AUDIO_DIR" -type f \( -iname \*.epub -o -iname \*.azw3 -o -iname \*.cbz -o -iname \*.pdf \) -exec sh -c ' + BOOK_INGEST="$1" + LOG_FILE="$2" + shift 2 + for file do + filename=$(basename "$file") + dest_calibre="$BOOK_INGEST/$filename" + + # Verify against log to prevent Calibre re-import loops + if ! grep -qxF "$file" "$LOG_FILE"; then + if [ ! -f "$dest_calibre" ]; then + ln "$file" "$dest_calibre" + echo "$file" >> "$LOG_FILE" + echo "Linked clean companion ebook to Calibre: $filename" + fi + fi + done + ' sh "$BOOK_INGEST" "$LOG_FILE" {} + + fi + + echo "Routing complete." + volumeMounts: + - name: yarr-volume + mountPath: /yarr + restartPolicy: OnFailure + volumes: + - name: yarr-volume + nfs: + server: robin.home.nest + path: /yarr diff --git a/services/tdarr/tdarr-deployment.yaml b/services/tdarr/tdarr-deployment.yaml index 435f2d7..6c210c8 100644 --- a/services/tdarr/tdarr-deployment.yaml +++ b/services/tdarr/tdarr-deployment.yaml @@ -15,6 +15,7 @@ spec: containers: - name: server image: ghcr.io/haveagitgat/tdarr:latest + env: - name: TZ value: "America/New_York" @@ -71,9 +72,15 @@ spec: labels: app: tdarr-node-cpu spec: + nodeSelector: + kubernetes.io/arch: amd64 # Only run on Robin which has QSV + securityContext: + supplementalGroups: [26, 303] # Matches NixOS 'video' (26) and 'render' (303) containers: - name: node image: ghcr.io/haveagitgat/tdarr_node:latest + securityContext: + privileged: true env: - name: TZ value: "America/New_York" @@ -94,13 +101,15 @@ spec: mountPath: /media - name: cache-volume mountPath: /temp + - name: dev-dri + mountPath: /dev/dri resources: requests: - cpu: "2000m" + cpu: "1500m" memory: "2Gi" limits: - cpu: "6" - memory: "4Gi" + cpu: "4" + memory: "5Gi" volumes: - name: media-volume nfs: @@ -109,3 +118,7 @@ spec: - name: cache-volume persistentVolumeClaim: claimName: tdarr-cache-rwx + - name: dev-dri + hostPath: + path: /dev/dri + type: Directory diff --git a/services/vault/vault-statefulset.yaml b/services/vault/vault-statefulset.yaml index 6d52753..e61835d 100644 --- a/services/vault/vault-statefulset.yaml +++ b/services/vault/vault-statefulset.yaml @@ -138,6 +138,9 @@ spec: volumeClaimTemplates: - metadata: name: data + labels: + recurring-job.longhorn.io/source: "enabled" + recurring-job-group.longhorn.io/app-config-group: "enabled" spec: accessModes: [ "ReadWriteOnce" ] storageClassName: longhorn