From b659c3ccd7a278740dba67a4b441b3d4f30f6b6a Mon Sep 17 00:00:00 2001 From: Fabio Uechi <308613+fabito@users.noreply.github.com> Date: Sun, 27 Apr 2025 13:13:53 +1200 Subject: [PATCH 1/3] feat: Add Readarr --- base/ingress-route.yaml | 9 +++ base/kustomization.yaml | 6 ++ base/radarr/deployment.yaml | 6 +- base/readarr/deployment.yaml | 81 +++++++++++++++++++++ base/readarr/kustomization.yaml | 5 ++ base/readarr/service.yaml | 11 +++ base/volumes_patch.yaml | 15 +++- install_armhf.yaml | 121 ++++++++++++++++++++++++++++++++ install_x86_64.yaml | 121 ++++++++++++++++++++++++++++++++ overlays/x86/kustomization.yaml | 2 + 10 files changed, 372 insertions(+), 5 deletions(-) create mode 100644 base/readarr/deployment.yaml create mode 100644 base/readarr/kustomization.yaml create mode 100644 base/readarr/service.yaml diff --git a/base/ingress-route.yaml b/base/ingress-route.yaml index 12afd46..082d772 100644 --- a/base/ingress-route.yaml +++ b/base/ingress-route.yaml @@ -69,3 +69,12 @@ spec: name: prowlarr namespace: "htpc" port: 9696 + - kind: Rule + match: PathPrefix(`/readarr`) + middlewares: [] + priority: 0 + services: + - kind: Service + name: readarr + namespace: "htpc" + port: 8787 \ No newline at end of file diff --git a/base/kustomization.yaml b/base/kustomization.yaml index af7d4a2..3c04211 100644 --- a/base/kustomization.yaml +++ b/base/kustomization.yaml @@ -16,6 +16,7 @@ resources: - transmission - emby - ingress-route.yaml +- readarr patchesStrategicMerge: - volumes_patch.yaml @@ -37,3 +38,8 @@ vars: kind: Service name: prowlarr apiVersion: v1 + - name: READARR + objref: + kind: Service + name: readarr + apiVersion: v1 diff --git a/base/radarr/deployment.yaml b/base/radarr/deployment.yaml index aca960e..ee68650 100644 --- a/base/radarr/deployment.yaml +++ b/base/radarr/deployment.yaml @@ -24,10 +24,10 @@ spec: image: busybox command: ["sh", "-c", "chown -R 1000:1000 /config && chown -R 1000:1000 /movies"] volumeMounts: - - mountPath: /config + - mountPath: /config name: htpc-home - subPath: radarr - - mountPath: /movies + subPath: radarr + - mountPath: /movies name: htpc-home subPath: media/movies - name: config diff --git a/base/readarr/deployment.yaml b/base/readarr/deployment.yaml new file mode 100644 index 0000000..858ea91 --- /dev/null +++ b/base/readarr/deployment.yaml @@ -0,0 +1,81 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: readarr +spec: + selector: + matchLabels: + app: readarr + template: + metadata: + labels: + app: readarr + spec: + securityContext: + fsGroup: 1000 + initContainers: + - name: chown + image: busybox + command: ["sh", "-c", "chown -R 1000:1000 /config && chown -R 1000:1000 /books"] + volumeMounts: + - mountPath: /config + name: htpc-home + subPath: readarr + - mountPath: /books + name: htpc-home + subPath: media/books + - name: config + image: busybox + command: ["sh", "-c"] + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + args: + - | + echo 'Customizing config...' + if [[ ! -f /config/config.xml ]]; then + echo '/$(READARR)'> /config/config.xml + fi + echo 'Done customizing.' + volumeMounts: + - mountPath: /config + name: htpc-home + subPath: readarr + containers: + - name: readarr + image: lscr.io/linuxserver/readarr + env: + - name: PUID + value: "1000" + - name: PGID + value: "1000" + - name: TZ + value: Pacific/Auckland + ports: + - containerPort: 8787 + livenessProbe: + exec: + command: + - /bin/sh + - -c + - curl "http://localhost:8787/readarr/api/v1/health?ApiKey=$(sed -ne '/ApiKey/{s/.*\(.*\)<\/ApiKey>.*/\1/p;q;}' \(.*\)<\/ApiKey>.*/\1/p;q;}' \(.*\)<\/ApiKey>.*/\1/p;q;}' + \(.*\)<\/ApiKey>.*/\1/p;q;}' /readarr'> /config/config.xml + fi + echo 'Done customizing.' + command: + - sh + - -c + image: busybox + name: config + securityContext: + runAsGroup: 1000 + runAsUser: 1000 + volumeMounts: + - mountPath: /config + name: htpc-home + subPath: readarr + securityContext: + fsGroup: 1000 + volumes: + - hostPath: + path: /opt/htpc + type: DirectoryOrCreate + name: htpc-home +--- +apiVersion: apps/v1 +kind: Deployment metadata: labels: app: htpc @@ -768,3 +880,12 @@ spec: name: prowlarr namespace: htpc port: 9696 + - kind: Rule + match: PathPrefix(`/readarr`) + middlewares: [] + priority: 0 + services: + - kind: Service + name: readarr + namespace: htpc + port: 8787 diff --git a/install_x86_64.yaml b/install_x86_64.yaml index e01611e..a62c8eb 100644 --- a/install_x86_64.yaml +++ b/install_x86_64.yaml @@ -93,6 +93,21 @@ spec: --- apiVersion: v1 kind: Service +metadata: + labels: + app: htpc + name: readarr + namespace: htpc +spec: + ports: + - name: web + port: 8787 + targetPort: 8787 + selector: + app: htpc +--- +apiVersion: v1 +kind: Service metadata: labels: app: htpc @@ -519,6 +534,103 @@ spec: --- apiVersion: apps/v1 kind: Deployment +metadata: + labels: + app: htpc + name: readarr + namespace: htpc +spec: + selector: + matchLabels: + app: htpc + template: + metadata: + labels: + app: htpc + spec: + containers: + - env: + - name: PUID + value: "1000" + - name: PGID + value: "1000" + - name: TZ + value: Pacific/Auckland + image: lscr.io/linuxserver/readarr:nightly-0.4.16.2788-ls395 + livenessProbe: + exec: + command: + - /bin/sh + - -c + - curl "http://localhost:8787/readarr/api/v1/health?ApiKey=$(sed -ne '/ApiKey/{s/.*\(.*\)<\/ApiKey>.*/\1/p;q;}' + \(.*\)<\/ApiKey>.*/\1/p;q;}' /readarr'> /config/config.xml + fi + echo 'Done customizing.' + command: + - sh + - -c + image: busybox + name: config + securityContext: + runAsGroup: 1000 + runAsUser: 1000 + volumeMounts: + - mountPath: /config + name: htpc-home + subPath: readarr + securityContext: + fsGroup: 1000 + volumes: + - hostPath: + path: /opt/htpc + type: DirectoryOrCreate + name: htpc-home +--- +apiVersion: apps/v1 +kind: Deployment metadata: labels: app: htpc @@ -768,3 +880,12 @@ spec: name: prowlarr namespace: htpc port: 9696 + - kind: Rule + match: PathPrefix(`/readarr`) + middlewares: [] + priority: 0 + services: + - kind: Service + name: readarr + namespace: htpc + port: 8787 diff --git a/overlays/x86/kustomization.yaml b/overlays/x86/kustomization.yaml index 2ecd692..ae15b9a 100644 --- a/overlays/x86/kustomization.yaml +++ b/overlays/x86/kustomization.yaml @@ -19,3 +19,5 @@ images: newTag: 4.9.0.50 - name: linuxserver/prowlarr newTag: 1.34.1.5021-ls115 + - name: lscr.io/linuxserver/readarr + newTag: nightly-0.4.16.2788-ls395 From 4e084493b8b1de200dbe0df051cb02bca17ceb7a Mon Sep 17 00:00:00 2001 From: Fabio Uechi <308613+fabito@users.noreply.github.com> Date: Sun, 27 Apr 2025 13:18:33 +1200 Subject: [PATCH 2/3] fix: selectors --- base/readarr/deployment.yaml | 7 +++++-- base/readarr/service.yaml | 7 ++++--- install_armhf.yaml | 8 +++++++- install_x86_64.yaml | 8 +++++++- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/base/readarr/deployment.yaml b/base/readarr/deployment.yaml index 858ea91..9a43a7e 100644 --- a/base/readarr/deployment.yaml +++ b/base/readarr/deployment.yaml @@ -1,15 +1,18 @@ apiVersion: apps/v1 kind: Deployment metadata: + labels: + run: readarr name: readarr spec: + replicas: 1 selector: matchLabels: - app: readarr + run: readarr template: metadata: labels: - app: readarr + run: readarr spec: securityContext: fsGroup: 1000 diff --git a/base/readarr/service.yaml b/base/readarr/service.yaml index 8169576..28166a3 100644 --- a/base/readarr/service.yaml +++ b/base/readarr/service.yaml @@ -3,9 +3,10 @@ kind: Service metadata: name: readarr spec: - selector: - app: readarr ports: - port: 8787 + protocol: TCP targetPort: 8787 - name: web + name: webui + selector: + run: readarr diff --git a/install_armhf.yaml b/install_armhf.yaml index 10f0adf..33a0995 100644 --- a/install_armhf.yaml +++ b/install_armhf.yaml @@ -100,11 +100,13 @@ metadata: namespace: htpc spec: ports: - - name: web + - name: webui port: 8787 + protocol: TCP targetPort: 8787 selector: app: htpc + run: readarr --- apiVersion: v1 kind: Service @@ -537,16 +539,20 @@ kind: Deployment metadata: labels: app: htpc + run: readarr name: readarr namespace: htpc spec: + replicas: 1 selector: matchLabels: app: htpc + run: readarr template: metadata: labels: app: htpc + run: readarr spec: containers: - env: diff --git a/install_x86_64.yaml b/install_x86_64.yaml index a62c8eb..3faace6 100644 --- a/install_x86_64.yaml +++ b/install_x86_64.yaml @@ -100,11 +100,13 @@ metadata: namespace: htpc spec: ports: - - name: web + - name: webui port: 8787 + protocol: TCP targetPort: 8787 selector: app: htpc + run: readarr --- apiVersion: v1 kind: Service @@ -537,16 +539,20 @@ kind: Deployment metadata: labels: app: htpc + run: readarr name: readarr namespace: htpc spec: + replicas: 1 selector: matchLabels: app: htpc + run: readarr template: metadata: labels: app: htpc + run: readarr spec: containers: - env: From 9b75de919ae8197258bf4622c24102ca57afd813 Mon Sep 17 00:00:00 2001 From: Fabio Uechi <308613+fabito@users.noreply.github.com> Date: Sun, 27 Apr 2025 13:23:36 +1200 Subject: [PATCH 3/3] docs: Add readarr and prowlarr to readme --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 740781d..e23ab8e 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,9 @@ It includes the following applications: * [Radarr](https://radarr.video/) for movies * [Bazarr](https://github.com/morpheus65535/bazarr) for subtitles * Transmission for torrents -* [Jackett](https://github.com/Jackett/Jackett) for torrent tracker searching +* ~~[Jackett](https://github.com/Jackett/Jackett) for torrent tracker searching~~ +* [Prowlarr](https://prowlarr.com/) for index management +* [Readarr](https://readarr.com/) for ebooks * [Emby](https://emby.media/) Applications state (settings / db) and media files are stored in a shared volume of type `hostPath`. It does not use PVC and currently only works if the whole `htpc` namespace is deployed in the same node. @@ -94,6 +96,8 @@ You should also be able to reach each component's UI using the links below. Don' |sonarr|http://localhost/sonarr |bazarr|http://localhost/bazarr |jacket|http://localhost/jackett +|prowlarr|http://localhost/prowlarr +|readarr|http://localhost/readarr |transmission|http://localhost/transmission |emby|http://localhost/ @@ -112,9 +116,11 @@ It uses a `hostPath` volume to store configuration and media files. It defaults ├── bazarr ├── downloads ├── emby -├── jackett +├── prowlarr +├── readarr ├── media │   ├── movies +│   ├── books │   └── tv ├── radarr ├── sonarr