From 404e9a58f1f8ec17388794ce3ad7af24feeb96d2 Mon Sep 17 00:00:00 2001 From: Philip Haupt <“der.mad.mob@gmail.com”> Date: Wed, 28 May 2025 19:44:53 +0200 Subject: [PATCH] lidarr --- lidarr/kustomization.yaml | 7 ++ lidarr/main.yaml | 142 ++++++++++++++++++++++++++++++++++ lidarr/pv.yaml | 17 ++++ lidarr/src/kustomization.yaml | 12 +++ lidarr/src/values.yaml | 119 ++++++++++++++++++++++++++++ 5 files changed, 297 insertions(+) create mode 100644 lidarr/kustomization.yaml create mode 100644 lidarr/main.yaml create mode 100644 lidarr/pv.yaml create mode 100644 lidarr/src/kustomization.yaml create mode 100644 lidarr/src/values.yaml diff --git a/lidarr/kustomization.yaml b/lidarr/kustomization.yaml new file mode 100644 index 0000000..7b313f5 --- /dev/null +++ b/lidarr/kustomization.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - main.yaml + - pv.yaml \ No newline at end of file diff --git a/lidarr/main.yaml b/lidarr/main.yaml new file mode 100644 index 0000000..9bb8d23 --- /dev/null +++ b/lidarr/main.yaml @@ -0,0 +1,142 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/instance: lidarr + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: lidarr + app.kubernetes.io/version: v1.0.0.2255 + helm.sh/chart: lidarr-14.2.2 + name: lidarr +spec: + ports: + - name: http + port: 8686 + protocol: TCP + targetPort: http + selector: + app.kubernetes.io/instance: lidarr + app.kubernetes.io/name: lidarr + type: ClusterIP +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + app.kubernetes.io/instance: lidarr + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: lidarr + app.kubernetes.io/version: v1.0.0.2255 + helm.sh/chart: lidarr-14.2.2 + name: lidarr-config +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5Gi + storageClassName: openebs-3-replicas +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + app.kubernetes.io/instance: lidarr + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: lidarr + app.kubernetes.io/version: v1.0.0.2255 + helm.sh/chart: lidarr-14.2.2 + name: lidarr-media +spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: 1Gi + storageClassName: nfs-storage + volumeName: nfs-media-sonarr +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/instance: lidarr + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: lidarr + app.kubernetes.io/version: v1.0.0.2255 + helm.sh/chart: lidarr-14.2.2 + name: lidarr +spec: + replicas: 1 + revisionHistoryLimit: 3 + selector: + matchLabels: + app.kubernetes.io/instance: lidarr + app.kubernetes.io/name: lidarr + strategy: + type: Recreate + template: + metadata: + labels: + app.kubernetes.io/instance: lidarr + app.kubernetes.io/name: lidarr + spec: + automountServiceAccountToken: true + containers: + - env: + - name: PGID + value: "1000" + - name: PUID + value: "1000" + - name: TZ + value: UTC + image: lscr.io/linuxserver/lidarr:2.11.2 + imagePullPolicy: IfNotPresent + livenessProbe: + exec: + command: + - /usr/bin/env + - bash + - -c + - curl --fail localhost:8686/api/v1/system/status?apiKey=`IFS=\> && while + read -d \< E C; do if [[ $E = "ApiKey" ]]; then echo $C; fi; done < + /config/config.xml` + failureThreshold: 5 + initialDelaySeconds: 60 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 10 + name: lidarr + ports: + - containerPort: 8686 + name: http + protocol: TCP + readinessProbe: + failureThreshold: 3 + initialDelaySeconds: 0 + periodSeconds: 10 + tcpSocket: + port: 8686 + timeoutSeconds: 1 + startupProbe: + failureThreshold: 30 + initialDelaySeconds: 0 + periodSeconds: 5 + tcpSocket: + port: 8686 + timeoutSeconds: 1 + volumeMounts: + - mountPath: /config + name: config + - mountPath: /media + name: media + dnsPolicy: ClusterFirst + enableServiceLinks: true + serviceAccountName: default + volumes: + - name: config + persistentVolumeClaim: + claimName: lidarr-config + - name: media + persistentVolumeClaim: + claimName: lidarr-media diff --git a/lidarr/pv.yaml b/lidarr/pv.yaml new file mode 100644 index 0000000..6692b7a --- /dev/null +++ b/lidarr/pv.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: nfs-media-lidarr +spec: + storageClassName: nfs-storage + capacity: + storage: 1Gi # Beachte: NFS ist dynamisch, die Größe ist nur ein Label + accessModes: + - ReadWriteMany # Mehrere Pods können es gleichzeitig nutzen + persistentVolumeReclaimPolicy: Retain + nfs: + path: /mnt/volume1/media # Der Pfad der NFS-Freigabe auf der NAS + server: 192.168.10.1 # Die IP-Adresse deiner NAS + mountOptions: + - nfsvers=4 # Passe ggf. an (nfsvers=3 falls nötig) \ No newline at end of file diff --git a/lidarr/src/kustomization.yaml b/lidarr/src/kustomization.yaml new file mode 100644 index 0000000..217eb58 --- /dev/null +++ b/lidarr/src/kustomization.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +helmCharts: + - name: lidarr + repo: https://k8s-at-home.com/charts/ + version: 14.2.2 + releaseName: lidarr + includeCRDs: true + namespace: lidarr + valuesFile: values.yaml diff --git a/lidarr/src/values.yaml b/lidarr/src/values.yaml new file mode 100644 index 0000000..3e8c2dd --- /dev/null +++ b/lidarr/src/values.yaml @@ -0,0 +1,119 @@ +# +# IMPORTANT NOTE +# +# This chart inherits from our common library chart. You can check the default values/options here: +# https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml +# + +image: + # -- image repository + repository: lscr.io/linuxserver/lidarr + # -- image tag + tag: 2.11.2 + # -- image pull policy + pullPolicy: IfNotPresent + +# -- environment variables. +# @default -- See below +env: + # -- Set the container timezone + TZ: UTC + PUID: 1000 + PGID: 1000 + +# -- Configures service settings for the chart. +# @default -- See values.yaml +service: + main: + ports: + http: + port: 8686 + +ingress: + # -- Enable and configure ingress settings for the chart under this key. + # @default -- See values.yaml + main: + enabled: false + +# -- Configures the probes for the main Pod. +# @default -- See values.yaml +probes: + liveness: + enabled: true + ## Set this to true if you wish to specify your own livenessProbe + custom: true + ## The spec field contains the values for the default livenessProbe. + ## If you selected custom: true, this field holds the definition of the livenessProbe. + spec: + exec: + command: + - /usr/bin/env + - bash + - -c + - curl --fail localhost:8686/api/v1/system/status?apiKey=`IFS=\> && while + read -d \< E C; do if [[ $E = "ApiKey" ]]; then echo $C; fi; done < /config/config.xml` + failureThreshold: 5 + initialDelaySeconds: 60 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 10 + +# -- Configure persistence settings for the chart under this key. +## Config persistence is required for the Prometheus exporter sidecar. +# @default -- See values.yaml +persistence: + config: + enabled: true + storageClass: openebs-3-replicas + accessMode: ReadWriteOnce + size: 5Gi + + media: + enabled: true + mountPath: /media + storageClass: nfs-storage + volumeName: nfs-media-sonarr + accessMode: ReadWriteMany + size: 1Gi + +metrics: + # -- Enable and configure Exportarr sidecar and Prometheus serviceMonitor. + # @default -- See values.yaml + enabled: false + serviceMonitor: + interval: 3m + scrapeTimeout: 1m + labels: {} + # -- Enable and configure Prometheus Rules for the chart under this key. + # @default -- See values.yaml + prometheusRule: + enabled: false + labels: {} + # -- Configure additionial rules for the chart under this key. + # @default -- See prometheusrules.yaml + rules: [] + # - alert: LidarrDown + # annotations: + # description: Lidarr service is down. + # summary: Lidarr is down. + # expr: | + # lidarr_system_status == 0 + # for: 5m + # labels: + # severity: critical + exporter: + image: + # -- image repository + repository: ghcr.io/onedr0p/exportarr + # -- image tag + tag: v1.0.0 + # -- image pull policy + pullPolicy: IfNotPresent + env: + # -- metrics port + port: 9792 + # -- Set to true to enable gathering of additional metrics (slow) + additionalMetrics: false + # -- Set to true to enable gathering unknown queue items + unknownQueueItems: false +