From b45f9a19a279067856c51cb74cb702c1443ed97a Mon Sep 17 00:00:00 2001 From: ahmza Date: Thu, 22 Oct 2026 08:08:53 +0000 Subject: [PATCH] deploy lidarr --- apps/lidarr.yaml | 27 +++++++++++++++++++ apps/lidarr/deployment.yaml | 52 +++++++++++++++++++++++++++++++++++++ apps/lidarr/ingress.yaml | 25 ++++++++++++++++++ apps/lidarr/namespace.yaml | 4 +++ apps/lidarr/pvc.yaml | 12 +++++++++ apps/lidarr/service.yaml | 12 +++++++++ 6 files changed, 132 insertions(+) create mode 100644 apps/lidarr.yaml create mode 100644 apps/lidarr/deployment.yaml create mode 100644 apps/lidarr/ingress.yaml create mode 100644 apps/lidarr/namespace.yaml create mode 100644 apps/lidarr/pvc.yaml create mode 100644 apps/lidarr/service.yaml diff --git a/apps/lidarr.yaml b/apps/lidarr.yaml new file mode 100644 index 0000000..b295649 --- /dev/null +++ b/apps/lidarr.yaml @@ -0,0 +1,27 @@ +# This Argo CD Application deploys Lidarr to manage the music library. +# It uses Hotio's lightweight Lidarr container image. +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: lidarr + namespace: argocd + # Omit the cascading finalizer so deleting this Application does not + # automatically delete Lidarr's config-bearing PersistentVolumeClaim. +spec: + project: default + + source: + repoURL: https://tea.ahmza.com/ahmza.com/k8s-starter-pack.git + targetRevision: main + path: apps/lidarr + + destination: + server: https://kubernetes.default.svc + namespace: lidarr + + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true diff --git a/apps/lidarr/deployment.yaml b/apps/lidarr/deployment.yaml new file mode 100644 index 0000000..a38ac71 --- /dev/null +++ b/apps/lidarr/deployment.yaml @@ -0,0 +1,52 @@ +# Lidarr image maintained by Hotio: ghcr.io/hotio/lidarr. +apiVersion: apps/v1 +kind: Deployment +metadata: + name: lidarr + namespace: lidarr +spec: + # not critical infrastructure a single pod should be sufficient + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: lidarr + template: + metadata: + labels: + app: lidarr + spec: + containers: + - name: lidarr + image: ghcr.io/hotio/lidarr:release + imagePullPolicy: Always + env: + - name: PUID + value: "1000" + - name: PGID + value: "1000" + - name: UMASK + value: "002" + - name: TZ + value: "Europe/London" + ports: + - name: http + containerPort: 8686 + protocol: TCP + volumeMounts: + - name: lidarr-config + mountPath: /config + # Mount each media directory directly instead of using subPath. + # The NFS export root is not listable by root-squashed clients, so + # kubelet cannot safely prepare subPath mounts from that root. + - name: music + mountPath: /data + volumes: + - name: lidarr-config + persistentVolumeClaim: + claimName: lidarr-data + - name: music + nfs: + server: nas.ahmza.com + path: /srv/media/Music diff --git a/apps/lidarr/ingress.yaml b/apps/lidarr/ingress.yaml new file mode 100644 index 0000000..4fee2f6 --- /dev/null +++ b/apps/lidarr/ingress.yaml @@ -0,0 +1,25 @@ +# Route lidarr.ahmza.com through ingress-nginx (docs/11-ingress.md). +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: lidarr + namespace: lidarr + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod +spec: + tls: + - hosts: + - lidarr.ahmza.com + # cert-manager keeps this up to date. nothing to do by hand + secretName: lidarr-tls + rules: + - host: lidarr.ahmza.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: lidarr + port: + number: 8686 diff --git a/apps/lidarr/namespace.yaml b/apps/lidarr/namespace.yaml new file mode 100644 index 0000000..4614354 --- /dev/null +++ b/apps/lidarr/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: lidarr diff --git a/apps/lidarr/pvc.yaml b/apps/lidarr/pvc.yaml new file mode 100644 index 0000000..3179b12 --- /dev/null +++ b/apps/lidarr/pvc.yaml @@ -0,0 +1,12 @@ +# Store Lidarr's config on a Longhorn volume (see docs/06-longhorn.md). +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: lidarr-data + namespace: lidarr +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi diff --git a/apps/lidarr/service.yaml b/apps/lidarr/service.yaml new file mode 100644 index 0000000..109e4f0 --- /dev/null +++ b/apps/lidarr/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: lidarr + namespace: lidarr +spec: + selector: + app: lidarr + ports: + - name: http + port: 8686 + targetPort: http