diff --git a/clusters/cl01tl/applications/homepage/templates/external-secret.yaml b/clusters/cl01tl/applications/homepage/templates/external-secret.yaml index b4a0aa82b..2b225a191 100644 --- a/clusters/cl01tl/applications/homepage/templates/external-secret.yaml +++ b/clusters/cl01tl/applications/homepage/templates/external-secret.yaml @@ -70,13 +70,20 @@ spec: key: /cl01tl/radarr5-4k/key metadataPolicy: None property: key - - secretKey: HOMEPAGE_VAR_LIDARR_KEY + - secretKey: HOMEPAGE_VAR_LIDARR2_KEY remoteRef: conversionStrategy: Default decodingStrategy: None key: /cl01tl/lidarr2/key metadataPolicy: None property: key + - secretKey: HOMEPAGE_VAR_READARR_BOOKS_KEY + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /cl01tl/readarr-books/key + metadataPolicy: None + property: key - secretKey: HOMEPAGE_VAR_PROWLARR_KEY remoteRef: conversionStrategy: Default diff --git a/clusters/cl01tl/applications/homepage/values.yaml b/clusters/cl01tl/applications/homepage/values.yaml index 1c66bc358..b3970f339 100644 --- a/clusters/cl01tl/applications/homepage/values.yaml +++ b/clusters/cl01tl/applications/homepage/values.yaml @@ -485,11 +485,11 @@ homepage: icon: sonarr.png description: TV Shows href: https://sonarr.alexlebens.net - siteMonitor: http://sonarr4.sonarr4:8989 + siteMonitor: http://sonarr4.sonarr4:80 statusStyle: dot widget: type: sonarr - url: http://sonarr4.sonarr4:8989 + url: http://sonarr4.sonarr4:80 key: {{ "{{HOMEPAGE_VAR_SONARR_KEY}}" }} fields: ["wanted", "queued", "series"] enableQueue: false @@ -497,11 +497,11 @@ homepage: icon: sonarr.png description: TV Shows 4K href: https://sonarr-4k.alexlebens.net - siteMonitor: http://sonarr4-4k.sonarr4-4k:8989 + siteMonitor: http://sonarr4-4k.sonarr4-4k:80 statusStyle: dot widget: type: sonarr - url: http://sonarr4-4k.sonarr4-4k:8989 + url: http://sonarr4-4k.sonarr4-4k:80 key: {{ "{{HOMEPAGE_VAR_SONARR4K_KEY}}" }} fields: ["wanted", "queued", "series"] enableQueue: false @@ -510,11 +510,11 @@ homepage: icon: radarr.png description: Movies href: https://radarr.alexlebens.net - siteMonitor: http://radarr5.radarr5:7878 + siteMonitor: http://radarr5.radarr5:80 statusStyle: dot widget: type: radarr - url: http://radarr5.radarr5:7878 + url: http://radarr5.radarr5:80 key: {{ "{{HOMEPAGE_VAR_RADARR_KEY}}" }} fields: ["wanted", "queued", "movies"] enableQueue: false @@ -522,11 +522,11 @@ homepage: icon: radarr.png description: Movies 4K href: https://radarr-4k.alexlebens.net - siteMonitor: http://radarr5-4k.radarr5-4k:7878 + siteMonitor: http://radarr5-4k.radarr5-4k:80 statusStyle: dot widget: type: radarr - url: http://radarr5-4k.radarr5-4k:7878 + url: http://radarr5-4k.radarr5-4k:80 key: {{ "{{HOMEPAGE_VAR_RADARR4K_KEY}}" }} fields: ["wanted", "queued", "movies"] enableQueue: false @@ -540,14 +540,20 @@ homepage: widget: type: lidarr url: http://lidarr2.lidarr2:80 - key: {{ "{{HOMEPAGE_VAR_LIDARR_KEY}}" }} + key: {{ "{{HOMEPAGE_VAR_LIDARR2_KEY}}" }} fields: ["wanted", "queued", "artists"] - Readarr Books: icon: readarr.png description: Books href: https://readarr-books.alexlebens.net - siteMonitor: http://readarr-books.readarr-books:8787 + siteMonitor: http://readarr-books.readarr-books:80 statusStyle: dot + widget: + type: readarr + url: http://readarr-books.readarr-books:80 + key: {{ "{{HOMEPAGE_VAR_READARR_BOOKS_KEY}}" }} + fields: ["wanted", "queued", "series"] + enableQueue: false - Lazy Librarian: icon: lazylibrarian.png description: Books diff --git a/clusters/cl01tl/applications/prowlarr/Chart.yaml b/clusters/cl01tl/applications/prowlarr/Chart.yaml index 48d72429e..340227440 100644 --- a/clusters/cl01tl/applications/prowlarr/Chart.yaml +++ b/clusters/cl01tl/applications/prowlarr/Chart.yaml @@ -10,12 +10,13 @@ home: "" sources: - https://github.com/Prowlarr/Prowlarr - https://github.com/onedr0p/containers/pkgs/container/prowlarr - - https://github.com/k8s-home-lab/helm-charts/tree/master/charts/stable/prowlarr + - https://github.com/bjw-s/helm-charts/tree/main/charts/other/app-template maintainers: - name: alexlebens dependencies: - - name: prowlarr - version: 5.1.2 - repository: https://k8s-home-lab.github.io/helm-charts/ + - name: app-template + alias: prowlarr + repository: https://bjw-s.github.io/helm-charts/ + version: 3.2.1 icon: https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/png/prowlarr.png appVersion: 1.18.0.4543 diff --git a/clusters/cl01tl/applications/prowlarr/values.yaml b/clusters/cl01tl/applications/prowlarr/values.yaml index 7bc542e58..5ae4dc2d0 100644 --- a/clusters/cl01tl/applications/prowlarr/values.yaml +++ b/clusters/cl01tl/applications/prowlarr/values.yaml @@ -1,13 +1,65 @@ -prowlarr: - image: - repository: ghcr.io/onedr0p/prowlarr - tag: 1.18.0.4543 - env: - TZ: US/Central +lidarr2: + controllers: + main: + type: deployment + replicas: 1 + strategy: Recreate + revisionHistoryLimit: 3 + pod: + securityContext: + runAsUser: 568 + runAsGroup: 568 + fsGroup: 568 + fsGroupChangePolicy: OnRootMismatch + supplementalGroups: + - 44 + - 100 + - 109 + - 65539 + containers: + main: + image: + repository: ghcr.io/onedr0p/prowlarr + tag: 1.18.0.4543 + pullPolicy: IfNotPresent + env: + - name: TZ + value: US/Central + probes: + liveness: + enabled: true + custom: true + 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 + resources: + requests: + cpu: 100m + memory: 256Mi + serviceAccount: + create: true + service: + main: + controller: main + ports: + http: + port: 80 + targetPort: 9696 + protocol: HTTP ingress: main: enabled: true - ingressClassName: traefik + className: traefik annotations: traefik.ingress.kubernetes.io/router.entrypoints: websecure traefik.ingress.kubernetes.io/router.tls: "true" @@ -17,22 +69,21 @@ prowlarr: paths: - path: / pathType: Prefix + service: + name: prowlarr + port: 80 tls: - secretName: prowlarr-secret-tls hosts: - prowlarr.alexlebens.net persistence: config: - enabled: true storageClass: ceph-block + accessMode: ReadWriteOnce size: 1Gi - podSecurityContext: - runAsUser: 1000 - runAsGroup: 1000 - fsGroup: 2000 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 44 - - 100 - - 109 - - 65539 + retain: true + advancedMounts: + main: + main: + - path: /config + readOnly: false diff --git a/clusters/cl01tl/applications/radarr5-4k/Chart.yaml b/clusters/cl01tl/applications/radarr5-4k/Chart.yaml index a71f5c017..5e6247ee8 100644 --- a/clusters/cl01tl/applications/radarr5-4k/Chart.yaml +++ b/clusters/cl01tl/applications/radarr5-4k/Chart.yaml @@ -14,14 +14,15 @@ sources: - https://github.com/cloudnative-pg/cloudnative-pg - https://github.com/onedr0p/containers/pkgs/container/radarr - https://github.com/onedr0p/exportarr/pkgs/container/exportarr - - https://github.com/k8s-home-lab/helm-charts/tree/master/charts/stable/radarr + - https://github.com/bjw-s/helm-charts/tree/main/charts/other/app-template - https://github.com/alexlebens/helm-charts/charts/postgres-cluster maintainers: - name: alexlebens dependencies: - - name: radarr - version: 17.1.2 - repository: https://k8s-home-lab.github.io/helm-charts/ + - name: app-template + alias: radarr5-4k + repository: https://bjw-s.github.io/helm-charts/ + version: 3.2.1 - name: postgres-cluster alias: postgres-16-cluster version: 3.5.0 diff --git a/clusters/cl01tl/applications/radarr5-4k/templates/persistent-volume-claim.yaml b/clusters/cl01tl/applications/radarr5-4k/templates/persistent-volume-claim.yaml index ea8cc465d..c816361fb 100644 --- a/clusters/cl01tl/applications/radarr5-4k/templates/persistent-volume-claim.yaml +++ b/clusters/cl01tl/applications/radarr5-4k/templates/persistent-volume-claim.yaml @@ -1,16 +1,16 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: "{{ .Release.Name }}-nfs-storage" + name: radarr5-4k-nfs-storage namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: radarr5-4k-nfs-storage app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: storage app.kubernetes.io/part-of: {{ .Release.Name }} spec: - volumeName: "{{ .Release.Name }}-nfs-storage" + volumeName: radarr5-4k-nfs-storage storageClassName: nfs-client accessModes: - ReadWriteMany diff --git a/clusters/cl01tl/applications/radarr5-4k/templates/persistent-volume.yaml b/clusters/cl01tl/applications/radarr5-4k/templates/persistent-volume.yaml index a9976778f..37cdb0dc6 100644 --- a/clusters/cl01tl/applications/radarr5-4k/templates/persistent-volume.yaml +++ b/clusters/cl01tl/applications/radarr5-4k/templates/persistent-volume.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: "{{ .Release.Name }}-nfs-storage" + name: radarr5-4k-nfs-storage namespace: {{ .Release.Namespace }} labels: app.kubernetes.io/name: {{ .Release.Name }} @@ -17,8 +17,8 @@ spec: accessModes: - ReadWriteMany nfs: - path: {{ .Values.persistence.media.nfsPath }} - server: {{ .Values.persistence.media.nfsServer }} + path: /volume2/Storage + server: synologybond.alexlebens.net mountOptions: - vers=4 - minorversion=1 diff --git a/clusters/cl01tl/applications/radarr5-4k/templates/prometheus-rule.yaml b/clusters/cl01tl/applications/radarr5-4k/templates/prometheus-rule.yaml new file mode 100644 index 000000000..cbbde00cf --- /dev/null +++ b/clusters/cl01tl/applications/radarr5-4k/templates/prometheus-rule.yaml @@ -0,0 +1,34 @@ +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: radarr5-4k + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: radarr5-4k + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: metrics + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + groups: + - name: radarr5-4k + rules: + - alert: ExportarrAbsent + annotations: + description: Radarr5 4K Exportarr has disappeared from Prometheus + service discovery. + summary: Exportarr is down. + expr: | + absent(up{job=~".*radarr5_4k.*"} == 1) + for: 5m + labels: + severity: critical + - alert: Radarr54kDown + annotations: + description: Radarr5 4K service is down. + summary: Radarr5 4K is down. + expr: | + radarr5_4k_system_status{job=~".*radarr5_4k.*"} == 0 + for: 5m + labels: + severity: critical diff --git a/clusters/cl01tl/applications/radarr5-4k/templates/service-monitor.yaml b/clusters/cl01tl/applications/radarr5-4k/templates/service-monitor.yaml new file mode 100644 index 000000000..5e85f38ff --- /dev/null +++ b/clusters/cl01tl/applications/radarr5-4k/templates/service-monitor.yaml @@ -0,0 +1,21 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: radarr5-4k + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: radarr5-4k + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: metrics + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: radarr5-4k + app.kubernetes.io/instance: {{ .Release.Name }} + endpoints: + - port: metrics + interval: 3m + scrapeTimeout: 1m + path: /metrics diff --git a/clusters/cl01tl/applications/radarr5-4k/values.yaml b/clusters/cl01tl/applications/radarr5-4k/values.yaml index d55d1394d..f7a0800a8 100644 --- a/clusters/cl01tl/applications/radarr5-4k/values.yaml +++ b/clusters/cl01tl/applications/radarr5-4k/values.yaml @@ -1,35 +1,114 @@ -radarr: - image: - repository: ghcr.io/onedr0p/radarr - tag: 5.7.0.8882 - env: - TZ: US/Central - RADARR__POSTGRES_MAIN_DB: radarr-main - RADARR__POSTGRES_LOG_DB: radarr-log - RADARR__POSTGRES_HOST: - valueFrom: - secretKeyRef: - name: radarr5-4k-postgresql-16-cluster-app - key: host - RADARR__POSTGRES_PORT: - valueFrom: - secretKeyRef: - name: radarr5-4k-postgresql-16-cluster-app - key: port - RADARR__POSTGRES_USER: - valueFrom: - secretKeyRef: - name: radarr5-4k-postgresql-16-cluster-app - key: user - RADARR__POSTGRES_PASSWORD: - valueFrom: - secretKeyRef: - name: radarr5-4k-postgresql-16-cluster-app - key: password +radarr5-4k: + controllers: + main: + type: deployment + replicas: 1 + strategy: Recreate + revisionHistoryLimit: 3 + pod: + securityContext: + runAsUser: 568 + runAsGroup: 568 + fsGroup: 568 + fsGroupChangePolicy: OnRootMismatch + supplementalGroups: + - 44 + - 100 + - 109 + - 65539 + containers: + main: + image: + repository: ghcr.io/onedr0p/radarr + tag: 5.7.0.8882 + pullPolicy: IfNotPresent + env: + - name: TZ + value: US/Central + - name: RADARR__POSTGRES_MAIN_DB + value: radarr-main + - name: RADARR__POSTGRES_LOG_DB + value: radarr-log + - name: RADARR__POSTGRES_HOST + valueFrom: + secretKeyRef: + name: radarr5-4k-postgresql-16-cluster-app + key: host + - name: RADARR__POSTGRES_PORT + valueFrom: + secretKeyRef: + name: radarr5-4k-postgresql-16-cluster-app + key: port + - name: RADARR__POSTGRES_USER + valueFrom: + secretKeyRef: + name: radarr5-4k-postgresql-16-cluster-app + key: username + - name: RADARR__POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: radarr5-4k-postgresql-16-cluster-app + key: password + probes: + liveness: + enabled: true + custom: true + spec: + exec: + command: + - /usr/bin/env + - bash + - -c + - curl --fail localhost:7878/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 + resources: + requests: + cpu: 100m + memory: 256Mi + metrics: + image: + repository: ghcr.io/onedr0p/exportarr + tag: v2.0.1 + pullPolicy: IfNotPresent + args: ["radarr"] + env: + - name: URL + value: http://localhost + - name: CONFIG + value: /config/config.xml + - name: PORT + value: 9793 + - name: ENABLE_ADDITIONAL_METRICS + value: false + - name: ENABLE_UNKNOWN_QUEUE_ITEMS + value: false + resources: + requests: + cpu: 100m + memory: 256Mi + serviceAccount: + create: true + service: + main: + controller: main + ports: + http: + port: 80 + targetPort: 7878 + protocol: HTTP + metrics: + port: 9793 + targetPort: 9793 + protocol: TCP ingress: main: enabled: true - ingressClassName: traefik + className: traefik annotations: traefik.ingress.kubernetes.io/router.entrypoints: websecure traefik.ingress.kubernetes.io/router.tls: "true" @@ -39,53 +118,34 @@ radarr: paths: - path: / pathType: Prefix + service: + name: radarr5-4k + port: 80 tls: - secretName: radarr5-4k-secret-tls hosts: - radarr-4k.alexlebens.net persistence: config: - enabled: true - mountPath: /config + storageClass: ceph-block accessMode: ReadWriteOnce size: 20Gi + retain: true + advancedMounts: + main: + main: + - path: /config + readOnly: false + metrics: + - path: /config + readOnly: true media: - enabled: true - mountPath: /mnt/store - type: pvc existingClaim: radarr5-4k-nfs-storage - podSecurityContext: - runAsUser: 1000 - runAsGroup: 1000 - fsGroup: 2000 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 44 - - 100 - - 109 - - 65539 - metrics: - enabled: true - prometheusRule: - enabled: true - rules: - - alert: RadarrDown - annotations: - description: Radarr 4k service is down. - summary: Radarr 4k is down. - expr: | - radarr_system_status == 0 - for: 5m - labels: - severity: critical - exporter: - image: - repository: ghcr.io/onedr0p/exportarr - tag: v2.0.1 -persistence: - media: - nfsPath: /volume2/Storage - nfsServer: synologybond.alexlebens.net + advancedMounts: + main: + main: + - path: /mnt/store + readOnly: false postgres-16-cluster: mode: standalone cluster: diff --git a/clusters/cl01tl/applications/radarr5/Chart.yaml b/clusters/cl01tl/applications/radarr5/Chart.yaml index 5adbef7af..90e27f55e 100644 --- a/clusters/cl01tl/applications/radarr5/Chart.yaml +++ b/clusters/cl01tl/applications/radarr5/Chart.yaml @@ -13,14 +13,15 @@ sources: - https://github.com/cloudnative-pg/cloudnative-pg - https://github.com/onedr0p/containers/pkgs/container/radarr - https://github.com/onedr0p/exportarr/pkgs/container/exportarr - - https://github.com/k8s-home-lab/helm-charts/tree/master/charts/stable/radarr + - https://github.com/bjw-s/helm-charts/tree/main/charts/other/app-template - https://github.com/alexlebens/helm-charts/charts/postgres-cluster maintainers: - name: alexlebens dependencies: - - name: radarr - version: 17.1.2 - repository: https://k8s-home-lab.github.io/helm-charts/ + - name: app-template + alias: radarr5 + repository: https://bjw-s.github.io/helm-charts/ + version: 3.2.1 - name: postgres-cluster alias: postgres-16-cluster version: 3.5.0 diff --git a/clusters/cl01tl/applications/radarr5/templates/persistent-volume-claim.yaml b/clusters/cl01tl/applications/radarr5/templates/persistent-volume-claim.yaml index ea8cc465d..e11dd4fe2 100644 --- a/clusters/cl01tl/applications/radarr5/templates/persistent-volume-claim.yaml +++ b/clusters/cl01tl/applications/radarr5/templates/persistent-volume-claim.yaml @@ -1,16 +1,16 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: "{{ .Release.Name }}-nfs-storage" + name: radarr5-nfs-storage namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: radarr5-nfs-storage app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: storage app.kubernetes.io/part-of: {{ .Release.Name }} spec: - volumeName: "{{ .Release.Name }}-nfs-storage" + volumeName: radarr5-nfs-storage storageClassName: nfs-client accessModes: - ReadWriteMany diff --git a/clusters/cl01tl/applications/radarr5/templates/persistent-volume.yaml b/clusters/cl01tl/applications/radarr5/templates/persistent-volume.yaml index a9976778f..d8c05c56d 100644 --- a/clusters/cl01tl/applications/radarr5/templates/persistent-volume.yaml +++ b/clusters/cl01tl/applications/radarr5/templates/persistent-volume.yaml @@ -1,10 +1,10 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: "{{ .Release.Name }}-nfs-storage" + name: radarr5-nfs-storage namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: radarr5-nfs-storage app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: storage @@ -17,8 +17,8 @@ spec: accessModes: - ReadWriteMany nfs: - path: {{ .Values.persistence.media.nfsPath }} - server: {{ .Values.persistence.media.nfsServer }} + path: /volume2/Storage + server: synologybond.alexlebens.net mountOptions: - vers=4 - minorversion=1 diff --git a/clusters/cl01tl/applications/radarr5/templates/prometheus-rule.yaml b/clusters/cl01tl/applications/radarr5/templates/prometheus-rule.yaml new file mode 100644 index 000000000..fc59c8796 --- /dev/null +++ b/clusters/cl01tl/applications/radarr5/templates/prometheus-rule.yaml @@ -0,0 +1,34 @@ +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: radarr5 + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: radarr5 + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: metrics + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + groups: + - name: radarr5 + rules: + - alert: ExportarrAbsent + annotations: + description: Radarr5 Exportarr has disappeared from Prometheus + service discovery. + summary: Exportarr is down. + expr: | + absent(up{job=~".*radarr5.*"} == 1) + for: 5m + labels: + severity: critical + - alert: Radarr5Down + annotations: + description: Radarr5 service is down. + summary: Radarr5 is down. + expr: | + radarr5_system_status{job=~".*radarr5.*"} == 0 + for: 5m + labels: + severity: critical diff --git a/clusters/cl01tl/applications/radarr5/templates/service-monitor.yaml b/clusters/cl01tl/applications/radarr5/templates/service-monitor.yaml new file mode 100644 index 000000000..a03a62d55 --- /dev/null +++ b/clusters/cl01tl/applications/radarr5/templates/service-monitor.yaml @@ -0,0 +1,21 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: radarr5 + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: radarr5 + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: metrics + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: radarr5 + app.kubernetes.io/instance: {{ .Release.Name }} + endpoints: + - port: metrics + interval: 3m + scrapeTimeout: 1m + path: /metrics diff --git a/clusters/cl01tl/applications/radarr5/values.yaml b/clusters/cl01tl/applications/radarr5/values.yaml index 961825128..250a205f6 100644 --- a/clusters/cl01tl/applications/radarr5/values.yaml +++ b/clusters/cl01tl/applications/radarr5/values.yaml @@ -1,35 +1,114 @@ -radarr: - image: - repository: ghcr.io/onedr0p/radarr - tag: 5.7.0.8882 - env: - TZ: US/Central - RADARR__POSTGRES_MAIN_DB: radarr-main - RADARR__POSTGRES_LOG_DB: radarr-log - RADARR__POSTGRES_HOST: - valueFrom: - secretKeyRef: - name: radarr5-postgresql-16-cluster-app - key: host - RADARR__POSTGRES_PORT: - valueFrom: - secretKeyRef: - name: radarr5-postgresql-16-cluster-app - key: port - RADARR__POSTGRES_USER: - valueFrom: - secretKeyRef: - name: radarr5-postgresql-16-cluster-app - key: user - RADARR__POSTGRES_PASSWORD: - valueFrom: - secretKeyRef: - name: radarr5-postgresql-16-cluster-app - key: password +radarr5: + controllers: + main: + type: deployment + replicas: 1 + strategy: Recreate + revisionHistoryLimit: 3 + pod: + securityContext: + runAsUser: 568 + runAsGroup: 568 + fsGroup: 568 + fsGroupChangePolicy: OnRootMismatch + supplementalGroups: + - 44 + - 100 + - 109 + - 65539 + containers: + main: + image: + repository: ghcr.io/onedr0p/radarr + tag: 5.7.0.8882 + pullPolicy: IfNotPresent + env: + - name: TZ + value: US/Central + - name: RADARR__POSTGRES_MAIN_DB + value: radarr-main + - name: RADARR__POSTGRES_LOG_DB + value: radarr-log + - name: RADARR__POSTGRES_HOST + valueFrom: + secretKeyRef: + name: radarr5-postgresql-16-cluster-app + key: host + - name: RADARR__POSTGRES_PORT + valueFrom: + secretKeyRef: + name: radarr5-postgresql-16-cluster-app + key: port + - name: RADARR__POSTGRES_USER + valueFrom: + secretKeyRef: + name: radarr5-postgresql-16-cluster-app + key: username + - name: RADARR__POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: radarr5-postgresql-16-cluster-app + key: password + probes: + liveness: + enabled: true + custom: true + spec: + exec: + command: + - /usr/bin/env + - bash + - -c + - curl --fail localhost:7878/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 + resources: + requests: + cpu: 100m + memory: 256Mi + metrics: + image: + repository: ghcr.io/onedr0p/exportarr + tag: v2.0.1 + pullPolicy: IfNotPresent + args: ["radarr"] + env: + - name: URL + value: http://localhost + - name: CONFIG + value: /config/config.xml + - name: PORT + value: 9793 + - name: ENABLE_ADDITIONAL_METRICS + value: false + - name: ENABLE_UNKNOWN_QUEUE_ITEMS + value: false + resources: + requests: + cpu: 100m + memory: 256Mi + serviceAccount: + create: true + service: + main: + controller: main + ports: + http: + port: 80 + targetPort: 7878 + protocol: HTTP + metrics: + port: 9793 + targetPort: 9793 + protocol: TCP ingress: main: enabled: true - ingressClassName: traefik + className: traefik annotations: traefik.ingress.kubernetes.io/router.entrypoints: websecure traefik.ingress.kubernetes.io/router.tls: "true" @@ -39,53 +118,34 @@ radarr: paths: - path: / pathType: Prefix + service: + name: radarr5 + port: 80 tls: - secretName: radarr5-secret-tls hosts: - radarr.alexlebens.net persistence: config: - enabled: true - mountPath: /config + storageClass: ceph-block accessMode: ReadWriteOnce size: 20Gi + retain: true + advancedMounts: + main: + main: + - path: /config + readOnly: false + metrics: + - path: /config + readOnly: true media: - enabled: true - mountPath: /mnt/store - type: pvc existingClaim: radarr5-nfs-storage - podSecurityContext: - runAsUser: 1000 - runAsGroup: 1000 - fsGroup: 2000 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 44 - - 100 - - 109 - - 65539 - metrics: - enabled: true - prometheusRule: - enabled: true - rules: - - alert: RadarrDown - annotations: - description: Radarr service is down. - summary: Radarr is down. - expr: | - radarr_system_status == 0 - for: 5m - labels: - severity: critical - exporter: - image: - repository: ghcr.io/onedr0p/exportarr - tag: v2.0.1 -persistence: - media: - nfsPath: /volume2/Storage - nfsServer: synologybond.alexlebens.net + advancedMounts: + main: + main: + - path: /mnt/store + readOnly: false postgres-16-cluster: mode: standalone cluster: diff --git a/clusters/cl01tl/applications/readarr-books/Chart.yaml b/clusters/cl01tl/applications/readarr-books/Chart.yaml index da030a466..dd31d2ef8 100644 --- a/clusters/cl01tl/applications/readarr-books/Chart.yaml +++ b/clusters/cl01tl/applications/readarr-books/Chart.yaml @@ -13,14 +13,15 @@ sources: - https://github.com/cloudnative-pg/cloudnative-pg - https://github.com/onedr0p/containers/pkgs/container/readarr-develop - https://github.com/onedr0p/exportarr/pkgs/container/exportarr - - https://github.com/k8s-home-lab/helm-charts/tree/master/charts/stable/readarr + - https://github.com/bjw-s/helm-charts/tree/main/charts/other/app-template - https://github.com/alexlebens/helm-charts/charts/postgres-cluster maintainers: - name: alexlebens dependencies: - - name: readarr - version: 7.1.2 - repository: https://k8s-home-lab.github.io/helm-charts/ + - name: app-template + alias: readarr-books + repository: https://bjw-s.github.io/helm-charts/ + version: 3.2.1 - name: postgres-cluster alias: postgres-16-cluster version: 3.5.0 diff --git a/clusters/cl01tl/applications/readarr-books/templates/persistent-volume-claim.yaml b/clusters/cl01tl/applications/readarr-books/templates/persistent-volume-claim.yaml index ea8cc465d..ef28a0c1a 100644 --- a/clusters/cl01tl/applications/readarr-books/templates/persistent-volume-claim.yaml +++ b/clusters/cl01tl/applications/readarr-books/templates/persistent-volume-claim.yaml @@ -1,16 +1,16 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: "{{ .Release.Name }}-nfs-storage" + name: readarr-boooks-nfs-storage namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: readarr-boooks-nfs-storage app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: storage app.kubernetes.io/part-of: {{ .Release.Name }} spec: - volumeName: "{{ .Release.Name }}-nfs-storage" + volumeName: readarr-boooks-nfs-storage storageClassName: nfs-client accessModes: - ReadWriteMany diff --git a/clusters/cl01tl/applications/readarr-books/templates/persistent-volume.yaml b/clusters/cl01tl/applications/readarr-books/templates/persistent-volume.yaml index a9976778f..959710dcd 100644 --- a/clusters/cl01tl/applications/readarr-books/templates/persistent-volume.yaml +++ b/clusters/cl01tl/applications/readarr-books/templates/persistent-volume.yaml @@ -1,10 +1,10 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: "{{ .Release.Name }}-nfs-storage" + name: readarr-boooks-nfs-storage namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: readarr-boooks-nfs-storage app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: storage @@ -17,8 +17,8 @@ spec: accessModes: - ReadWriteMany nfs: - path: {{ .Values.persistence.media.nfsPath }} - server: {{ .Values.persistence.media.nfsServer }} + path: /volume2/Storage + server: synologybond.alexlebens.net mountOptions: - vers=4 - minorversion=1 diff --git a/clusters/cl01tl/applications/readarr-books/templates/prometheus-rule.yaml b/clusters/cl01tl/applications/readarr-books/templates/prometheus-rule.yaml new file mode 100644 index 000000000..4ed2626ec --- /dev/null +++ b/clusters/cl01tl/applications/readarr-books/templates/prometheus-rule.yaml @@ -0,0 +1,34 @@ +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: readarr-books + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: readarr-books + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: metrics + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + groups: + - name: readarr-books + rules: + - alert: ExportarrAbsent + annotations: + description: Readarr Books Exportarr has disappeared from Prometheus + service discovery. + summary: Exportarr is down. + expr: | + absent(up{job=~".*readarr_books.*"} == 1) + for: 5m + labels: + severity: critical + - alert: ReadarrBooksDown + annotations: + description: Readarr Books service is down. + summary: Readarr Books is down. + expr: | + readarr_books_system_status{job=~".*readarr_books.*"} == 0 + for: 5m + labels: + severity: critical diff --git a/clusters/cl01tl/applications/readarr-books/templates/service-monitor.yaml b/clusters/cl01tl/applications/readarr-books/templates/service-monitor.yaml new file mode 100644 index 000000000..bf089c6cc --- /dev/null +++ b/clusters/cl01tl/applications/readarr-books/templates/service-monitor.yaml @@ -0,0 +1,21 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: readarr-books + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: readarr-books + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: metrics + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: readarr-books + app.kubernetes.io/instance: {{ .Release.Name }} + endpoints: + - port: metrics + interval: 3m + scrapeTimeout: 1m + path: /metrics diff --git a/clusters/cl01tl/applications/readarr-books/values.yaml b/clusters/cl01tl/applications/readarr-books/values.yaml index 71f29acc3..a1f6f1047 100644 --- a/clusters/cl01tl/applications/readarr-books/values.yaml +++ b/clusters/cl01tl/applications/readarr-books/values.yaml @@ -1,36 +1,116 @@ -readarr: - image: - repository: ghcr.io/onedr0p/readarr-develop - tag: 0.3.28.2554 - env: - TZ: US/Central - READARR__POSTGRES_MAIN_DB: readarr-main - READARR__POSTGRES_LOG_DB: readarr-log - READARR__POSTGRES_CACHE_DB: readarr-cache - READARR__POSTGRES_HOST: - valueFrom: - secretKeyRef: - name: readarr-books-postgresql-16-cluster-app - key: host - READARR__POSTGRES_PORT: - valueFrom: - secretKeyRef: - name: readarr-books-postgresql-16-cluster-app - key: port - READARR__POSTGRES_USER: - valueFrom: - secretKeyRef: - name: readarr-books-postgresql-16-cluster-app - key: user - READARR__POSTGRES_PASSWORD: - valueFrom: - secretKeyRef: - name: readarr-books-postgresql-16-cluster-app - key: password +readarr-books: + controllers: + main: + type: deployment + replicas: 1 + strategy: Recreate + revisionHistoryLimit: 3 + pod: + securityContext: + runAsUser: 568 + runAsGroup: 568 + fsGroup: 568 + fsGroupChangePolicy: OnRootMismatch + supplementalGroups: + - 44 + - 100 + - 109 + - 65539 + containers: + main: + image: + repository: ghcr.io/onedr0p/readarr-develop + tag: 0.3.28.2554 + pullPolicy: IfNotPresent + env: + - name: TZ + value: US/Central + - name: READARR__POSTGRES_MAIN_DB + value: readarr-main + - name: READARR__POSTGRES_LOG_DB + value: readarr-log + - name: READARR__POSTGRES_CACHE_DB + value: readarr-cache + - name: READARR__POSTGRES_HOST + valueFrom: + secretKeyRef: + name: readarr-books-postgresql-16-cluster-app + key: host + - name: READARR__POSTGRES_PORT + valueFrom: + secretKeyRef: + name: readarr-books-postgresql-16-cluster-app + key: port + - name: READARR__POSTGRES_USER + valueFrom: + secretKeyRef: + name: readarr-books-postgresql-16-cluster-app + key: username + - name: READARR__POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: readarr-books-postgresql-16-cluster-app + key: password + probes: + liveness: + enabled: true + custom: true + spec: + exec: + command: + - /usr/bin/env + - bash + - -c + - curl --fail localhost:8787/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 + resources: + requests: + cpu: 100m + memory: 256Mi + metrics: + image: + repository: ghcr.io/onedr0p/exportarr + tag: v2.0.1 + pullPolicy: IfNotPresent + args: ["readarr"] + env: + - name: URL + value: http://localhost + - name: CONFIG + value: /config/config.xml + - name: PORT + value: 9796 + - name: ENABLE_ADDITIONAL_METRICS + value: false + - name: ENABLE_UNKNOWN_QUEUE_ITEMS + value: false + resources: + requests: + cpu: 100m + memory: 256Mi + serviceAccount: + create: true + service: + main: + controller: main + ports: + http: + port: 80 + targetPort: 8787 + protocol: HTTP + metrics: + port: 9795 + targetPort: 9795 + protocol: TCP ingress: main: enabled: true - ingressClassName: traefik + className: traefik annotations: traefik.ingress.kubernetes.io/router.entrypoints: websecure traefik.ingress.kubernetes.io/router.tls: "true" @@ -40,53 +120,34 @@ readarr: paths: - path: / pathType: Prefix + service: + name: readarr-books + port: 80 tls: - secretName: readarr-books-secret-tls hosts: - readarr-books.alexlebens.net persistence: config: - enabled: true - mountPath: /config + storageClass: ceph-block accessMode: ReadWriteOnce size: 20Gi + retain: true + advancedMounts: + main: + main: + - path: /config + readOnly: false + metrics: + - path: /config + readOnly: true media: - enabled: true - mountPath: /mnt/store - type: pvc existingClaim: readarr-books-nfs-storage - podSecurityContext: - runAsUser: 1000 - runAsGroup: 1000 - fsGroup: 2000 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 44 - - 100 - - 109 - - 65539 - metrics: - enabled: true - prometheusRule: - enabled: true - rules: - - alert: ReadarrBooksDown - annotations: - description: Readarr Books service is down. - summary: Readarr Books is down. - expr: | - readarr_books_system_status == 0 - for: 5m - labels: - severity: critical - exporter: - image: - repository: ghcr.io/onedr0p/exportarr - tag: v2.0.1 -persistence: - media: - nfsPath: /volume2/Storage - nfsServer: synologybond.alexlebens.net + advancedMounts: + main: + main: + - path: /mnt/store + readOnly: false postgres-16-cluster: mode: standalone cluster: diff --git a/clusters/cl01tl/applications/sonarr4-4k/Chart.yaml b/clusters/cl01tl/applications/sonarr4-4k/Chart.yaml index 5f0165aab..4eac1213b 100644 --- a/clusters/cl01tl/applications/sonarr4-4k/Chart.yaml +++ b/clusters/cl01tl/applications/sonarr4-4k/Chart.yaml @@ -13,16 +13,17 @@ home: "" sources: - https://github.com/Sonarr/Sonarr - https://github.com/cloudnative-pg/cloudnative-pg - - ttps://github.com/onedr0p/containers/pkgs/container/sonarr + - https://github.com/onedr0p/containers/pkgs/container/sonarr - https://github.com/onedr0p/exportarr/pkgs/container/exportarr - - https://github.com/k8s-home-lab/helm-charts/tree/master/charts/stable/sonarr + - https://github.com/bjw-s/helm-charts/tree/main/charts/other/app-template - https://github.com/alexlebens/helm-charts/charts/postgres-cluster maintainers: - name: alexlebens dependencies: - - name: sonarr - version: 17.1.1 - repository: https://k8s-home-lab.github.io/helm-charts/ + - name: app-template + alias: sonarr4-4k + repository: https://bjw-s.github.io/helm-charts/ + version: 3.2.1 - name: postgres-cluster alias: postgres-16-cluster version: 3.5.0 diff --git a/clusters/cl01tl/applications/sonarr4-4k/templates/persistent-volume-claim.yaml b/clusters/cl01tl/applications/sonarr4-4k/templates/persistent-volume-claim.yaml index ea8cc465d..c453fe08c 100644 --- a/clusters/cl01tl/applications/sonarr4-4k/templates/persistent-volume-claim.yaml +++ b/clusters/cl01tl/applications/sonarr4-4k/templates/persistent-volume-claim.yaml @@ -1,16 +1,16 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: "{{ .Release.Name }}-nfs-storage" + name: sonarr4-4k-nfs-storage namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: sonarr4-4k-nfs-storage app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: storage app.kubernetes.io/part-of: {{ .Release.Name }} spec: - volumeName: "{{ .Release.Name }}-nfs-storage" + volumeName: sonarr4-4k-nfs-storage storageClassName: nfs-client accessModes: - ReadWriteMany diff --git a/clusters/cl01tl/applications/sonarr4-4k/templates/persistent-volume.yaml b/clusters/cl01tl/applications/sonarr4-4k/templates/persistent-volume.yaml index a9976778f..91261233e 100644 --- a/clusters/cl01tl/applications/sonarr4-4k/templates/persistent-volume.yaml +++ b/clusters/cl01tl/applications/sonarr4-4k/templates/persistent-volume.yaml @@ -1,10 +1,10 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: "{{ .Release.Name }}-nfs-storage" + name: sonarr4-4k-nfs-storage namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: sonarr4-4k-nfs-storage app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: storage @@ -17,8 +17,8 @@ spec: accessModes: - ReadWriteMany nfs: - path: {{ .Values.persistence.media.nfsPath }} - server: {{ .Values.persistence.media.nfsServer }} + path: /volume2/Storage + server: synologybond.alexlebens.net mountOptions: - vers=4 - minorversion=1 diff --git a/clusters/cl01tl/applications/sonarr4-4k/templates/prometheus-rule.yaml b/clusters/cl01tl/applications/sonarr4-4k/templates/prometheus-rule.yaml new file mode 100644 index 000000000..495a5eedf --- /dev/null +++ b/clusters/cl01tl/applications/sonarr4-4k/templates/prometheus-rule.yaml @@ -0,0 +1,34 @@ +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: sonarr4-4k + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: sonarr4-4k + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: metrics + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + groups: + - name: sonarr4-4k + rules: + - alert: ExportarrAbsent + annotations: + description: Sonarr4 4K Exportarr has disappeared from Prometheus + service discovery. + summary: Exportarr is down. + expr: | + absent(up{job=~".*sonarr4_4k.*"} == 1) + for: 5m + labels: + severity: critical + - alert: Sonarr44KDown + annotations: + description: Sonarr4 4K service is down. + summary: Sonarr4 4K is down. + expr: | + sonarr4_4k_system_status{job=~".*sonarr4_4k.*"} == 0 + for: 5m + labels: + severity: critical diff --git a/clusters/cl01tl/applications/sonarr4-4k/templates/service-monitor.yaml b/clusters/cl01tl/applications/sonarr4-4k/templates/service-monitor.yaml new file mode 100644 index 000000000..978aabc59 --- /dev/null +++ b/clusters/cl01tl/applications/sonarr4-4k/templates/service-monitor.yaml @@ -0,0 +1,21 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: sonarr4-4k + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: sonarr4-4k + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: metrics + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: sonarr4-4k + app.kubernetes.io/instance: {{ .Release.Name }} + endpoints: + - port: metrics + interval: 3m + scrapeTimeout: 1m + path: /metrics diff --git a/clusters/cl01tl/applications/sonarr4-4k/values.yaml b/clusters/cl01tl/applications/sonarr4-4k/values.yaml index 9bb92035c..d9d5cade7 100644 --- a/clusters/cl01tl/applications/sonarr4-4k/values.yaml +++ b/clusters/cl01tl/applications/sonarr4-4k/values.yaml @@ -1,35 +1,114 @@ -sonarr: - image: - repository: ghcr.io/onedr0p/sonarr - tag: 4.0.5.1710 - env: - TZ: US/Central - SONARR__POSTGRES_MAIN_DB: sonarr-main - SONARR__POSTGRES_LOG_DB: sonarr-log - SONARR__POSTGRES_HOST: - valueFrom: - secretKeyRef: - name: sonarr4-4k-postgresql-16-cluster-app - key: host - SONARR__POSTGRES_PORT: - valueFrom: - secretKeyRef: - name: sonarr4-4k-postgresql-16-cluster-app - key: port - SONARR__POSTGRES_USER: - valueFrom: - secretKeyRef: - name: sonarr4-4k-postgresql-16-cluster-app - key: user - SONARR__POSTGRES_PASSWORD: - valueFrom: - secretKeyRef: - name: sonarr4-4k-postgresql-16-cluster-app - key: password +sonarr4: + controllers: + main: + type: deployment + replicas: 1 + strategy: Recreate + revisionHistoryLimit: 3 + pod: + securityContext: + runAsUser: 568 + runAsGroup: 568 + fsGroup: 568 + fsGroupChangePolicy: OnRootMismatch + supplementalGroups: + - 44 + - 100 + - 109 + - 65539 + containers: + main: + image: + repository: ghcr.io/onedr0p/sonarr + tag: 4.0.5.1710 + pullPolicy: IfNotPresent + env: + - name: TZ + value: US/Central + - name: SONARR__POSTGRES_MAIN_DB + value: sonarr-main + - name: SONARR__POSTGRES_MAIN_DB + value: sonarr-log + - name: SONARR__POSTGRES_HOST + valueFrom: + secretKeyRef: + name: sonarr4-4k-postgresql-16-cluster-app + key: host + - name: SONARR__POSTGRES_PORT + valueFrom: + secretKeyRef: + name: sonarr4-4k-postgresql-16-cluster-app + key: port + - name: SONARR__POSTGRES_USER + valueFrom: + secretKeyRef: + name: sonarr4-4k-postgresql-16-cluster-app + key: username + - name: SONARR__POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: sonarr4-4k-postgresql-16-cluster-app + key: password + probes: + liveness: + enabled: true + custom: true + spec: + exec: + command: + - /usr/bin/env + - bash + - -c + - curl --fail localhost:8989/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 + resources: + requests: + cpu: 100m + memory: 256Mi + metrics: + image: + repository: ghcr.io/onedr0p/exportarr + tag: v2.0.1 + pullPolicy: IfNotPresent + args: ["sonarr"] + env: + - name: URL + value: http://localhost + - name: CONFIG + value: /config/config.xml + - name: PORT + value: 9794 + - name: ENABLE_ADDITIONAL_METRICS + value: false + - name: ENABLE_UNKNOWN_QUEUE_ITEMS + value: false + resources: + requests: + cpu: 100m + memory: 256Mi + serviceAccount: + create: true + service: + main: + controller: main + ports: + http: + port: 80 + targetPort: 8989 + protocol: HTTP + metrics: + port: 9794 + targetPort: 9794 + protocol: TCP ingress: main: enabled: true - ingressClassName: traefik + className: traefik annotations: traefik.ingress.kubernetes.io/router.entrypoints: websecure traefik.ingress.kubernetes.io/router.tls: "true" @@ -39,53 +118,34 @@ sonarr: paths: - path: / pathType: Prefix + service: + name: sonarr4-4k + port: 80 tls: - secretName: sonarr4-4k-secret-tls hosts: - sonarr-4k.alexlebens.net persistence: config: - enabled: true - mountPath: /config + storageClass: ceph-block accessMode: ReadWriteOnce size: 20Gi + retain: true + advancedMounts: + main: + main: + - path: /config + readOnly: false + metrics: + - path: /config + readOnly: true media: - enabled: true - mountPath: /mnt/store - type: pvc existingClaim: sonarr4-4k-nfs-storage - podSecurityContext: - runAsUser: 1000 - runAsGroup: 1000 - fsGroup: 2000 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 44 - - 100 - - 109 - - 65539 - metrics: - enabled: true - prometheusRule: - enabled: true - rules: - - alert: SonarrDown - annotations: - description: Sonarr 4k service is down. - summary: Sonarr 4k is down. - expr: | - sonarr_system_status == 0 - for: 5m - labels: - severity: critical - exporter: - image: - repository: ghcr.io/onedr0p/exportarr - tag: v2.0.1 -persistence: - media: - nfsPath: /volume2/Storage - nfsServer: synologybond.alexlebens.net + advancedMounts: + main: + main: + - path: /mnt/store + readOnly: false postgres-16-cluster: mode: standalone cluster: diff --git a/clusters/cl01tl/applications/sonarr4/Chart.yaml b/clusters/cl01tl/applications/sonarr4/Chart.yaml index 2489d40a0..b4e6b9306 100644 --- a/clusters/cl01tl/applications/sonarr4/Chart.yaml +++ b/clusters/cl01tl/applications/sonarr4/Chart.yaml @@ -12,16 +12,17 @@ home: "" sources: - https://github.com/Sonarr/Sonarr - https://github.com/cloudnative-pg/cloudnative-pg - - ttps://github.com/onedr0p/containers/pkgs/container/sonarr + - https://github.com/onedr0p/containers/pkgs/container/sonarr - https://github.com/onedr0p/exportarr/pkgs/container/exportarr - - https://github.com/k8s-home-lab/helm-charts/tree/master/charts/stable/sonarr + - https://github.com/bjw-s/helm-charts/tree/main/charts/other/app-template - https://github.com/alexlebens/helm-charts/charts/postgres-cluster maintainers: - name: alexlebens dependencies: - - name: sonarr - version: 17.1.1 - repository: https://k8s-home-lab.github.io/helm-charts/ + - name: app-template + alias: sonarr4 + repository: https://bjw-s.github.io/helm-charts/ + version: 3.2.1 - name: postgres-cluster alias: postgres-16-cluster version: 3.5.0 diff --git a/clusters/cl01tl/applications/sonarr4/templates/persistent-volume-claim.yaml b/clusters/cl01tl/applications/sonarr4/templates/persistent-volume-claim.yaml index ea8cc465d..9d4e06d17 100644 --- a/clusters/cl01tl/applications/sonarr4/templates/persistent-volume-claim.yaml +++ b/clusters/cl01tl/applications/sonarr4/templates/persistent-volume-claim.yaml @@ -1,16 +1,16 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: "{{ .Release.Name }}-nfs-storage" + name: sonarr4-nfs-storage namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: sonarr4-nfs-storage app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: storage app.kubernetes.io/part-of: {{ .Release.Name }} spec: - volumeName: "{{ .Release.Name }}-nfs-storage" + volumeName: sonarr4-nfs-storage storageClassName: nfs-client accessModes: - ReadWriteMany diff --git a/clusters/cl01tl/applications/sonarr4/templates/persistent-volume.yaml b/clusters/cl01tl/applications/sonarr4/templates/persistent-volume.yaml index a9976778f..82edb5205 100644 --- a/clusters/cl01tl/applications/sonarr4/templates/persistent-volume.yaml +++ b/clusters/cl01tl/applications/sonarr4/templates/persistent-volume.yaml @@ -1,10 +1,10 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: "{{ .Release.Name }}-nfs-storage" + name: sonarr4-nfs-storage namespace: {{ .Release.Namespace }} labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: sonarr4-nfs-storage app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: storage @@ -17,8 +17,8 @@ spec: accessModes: - ReadWriteMany nfs: - path: {{ .Values.persistence.media.nfsPath }} - server: {{ .Values.persistence.media.nfsServer }} + path: /volume2/Storage + server: synologybond.alexlebens.net mountOptions: - vers=4 - minorversion=1 diff --git a/clusters/cl01tl/applications/sonarr4/templates/prometheus-rule.yaml b/clusters/cl01tl/applications/sonarr4/templates/prometheus-rule.yaml new file mode 100644 index 000000000..d260b61e9 --- /dev/null +++ b/clusters/cl01tl/applications/sonarr4/templates/prometheus-rule.yaml @@ -0,0 +1,34 @@ +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: sonarr4 + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: sonarr4 + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: metrics + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + groups: + - name: sonarr4 + rules: + - alert: ExportarrAbsent + annotations: + description: Sonarr4 Exportarr has disappeared from Prometheus + service discovery. + summary: Exportarr is down. + expr: | + absent(up{job=~".*sonarr4.*"} == 1) + for: 5m + labels: + severity: critical + - alert: Sonarr4Down + annotations: + description: Sonarr4 service is down. + summary: Sonarr4 is down. + expr: | + sonarr4_system_status{job=~".*sonarr4.*"} == 0 + for: 5m + labels: + severity: critical diff --git a/clusters/cl01tl/applications/sonarr4/templates/service-monitor.yaml b/clusters/cl01tl/applications/sonarr4/templates/service-monitor.yaml new file mode 100644 index 000000000..a86d6fc63 --- /dev/null +++ b/clusters/cl01tl/applications/sonarr4/templates/service-monitor.yaml @@ -0,0 +1,21 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: sonarr4 + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: sonarr4 + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: metrics + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: sonarr4 + app.kubernetes.io/instance: {{ .Release.Name }} + endpoints: + - port: metrics + interval: 3m + scrapeTimeout: 1m + path: /metrics diff --git a/clusters/cl01tl/applications/sonarr4/values.yaml b/clusters/cl01tl/applications/sonarr4/values.yaml index 5747cd470..d2fe87d4c 100644 --- a/clusters/cl01tl/applications/sonarr4/values.yaml +++ b/clusters/cl01tl/applications/sonarr4/values.yaml @@ -1,35 +1,114 @@ -sonarr: - image: - repository: ghcr.io/onedr0p/sonarr - tag: 4.0.5.1710 - env: - TZ: US/Central - SONARR__POSTGRES_MAIN_DB: sonarr-main - SONARR__POSTGRES_LOG_DB: sonarr-log - SONARR__POSTGRES_HOST: - valueFrom: - secretKeyRef: - name: sonarr4-postgresql-16-cluster-app - key: host - SONARR__POSTGRES_PORT: - valueFrom: - secretKeyRef: - name: sonarr4-postgresql-16-cluster-app - key: port - SONARR__POSTGRES_USER: - valueFrom: - secretKeyRef: - name: sonarr4-postgresql-16-cluster-app - key: user - SONARR__POSTGRES_PASSWORD: - valueFrom: - secretKeyRef: - name: sonarr4-postgresql-16-cluster-app - key: password +sonarr4: + controllers: + main: + type: deployment + replicas: 1 + strategy: Recreate + revisionHistoryLimit: 3 + pod: + securityContext: + runAsUser: 568 + runAsGroup: 568 + fsGroup: 568 + fsGroupChangePolicy: OnRootMismatch + supplementalGroups: + - 44 + - 100 + - 109 + - 65539 + containers: + main: + image: + repository: ghcr.io/onedr0p/sonarr + tag: 4.0.5.1710 + pullPolicy: IfNotPresent + env: + - name: TZ + value: US/Central + - name: SONARR__POSTGRES_MAIN_DB + value: sonarr-main + - name: SONARR__POSTGRES_MAIN_DB + value: sonarr-log + - name: SONARR__POSTGRES_HOST + valueFrom: + secretKeyRef: + name: sonarr4-postgresql-16-cluster-app + key: host + - name: SONARR__POSTGRES_PORT + valueFrom: + secretKeyRef: + name: sonarr4-postgresql-16-cluster-app + key: port + - name: SONARR__POSTGRES_USER + valueFrom: + secretKeyRef: + name: sonarr4-postgresql-16-cluster-app + key: username + - name: SONARR__POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: sonarr4-postgresql-16-cluster-app + key: password + probes: + liveness: + enabled: true + custom: true + spec: + exec: + command: + - /usr/bin/env + - bash + - -c + - curl --fail localhost:8989/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 + resources: + requests: + cpu: 100m + memory: 256Mi + metrics: + image: + repository: ghcr.io/onedr0p/exportarr + tag: v2.0.1 + pullPolicy: IfNotPresent + args: ["sonarr"] + env: + - name: URL + value: http://localhost + - name: CONFIG + value: /config/config.xml + - name: PORT + value: 9794 + - name: ENABLE_ADDITIONAL_METRICS + value: false + - name: ENABLE_UNKNOWN_QUEUE_ITEMS + value: false + resources: + requests: + cpu: 100m + memory: 256Mi + serviceAccount: + create: true + service: + main: + controller: main + ports: + http: + port: 80 + targetPort: 8989 + protocol: HTTP + metrics: + port: 9794 + targetPort: 9794 + protocol: TCP ingress: main: enabled: true - ingressClassName: traefik + className: traefik annotations: traefik.ingress.kubernetes.io/router.entrypoints: websecure traefik.ingress.kubernetes.io/router.tls: "true" @@ -39,53 +118,34 @@ sonarr: paths: - path: / pathType: Prefix + service: + name: sonarr4 + port: 80 tls: - secretName: sonarr4-secret-tls hosts: - sonarr.alexlebens.net persistence: config: - enabled: true - mountPath: /config + storageClass: ceph-block accessMode: ReadWriteOnce size: 20Gi + retain: true + advancedMounts: + main: + main: + - path: /config + readOnly: false + metrics: + - path: /config + readOnly: true media: - enabled: true - mountPath: /mnt/store - type: pvc existingClaim: sonarr4-nfs-storage - podSecurityContext: - runAsUser: 1000 - runAsGroup: 1000 - fsGroup: 2000 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 44 - - 100 - - 109 - - 65539 - metrics: - enabled: true - prometheusRule: - enabled: true - rules: - - alert: SonarrDown - annotations: - description: Sonarr service is down. - summary: Sonarr is down. - expr: | - sonarr_system_status == 0 - for: 5m - labels: - severity: critical - exporter: - image: - repository: ghcr.io/onedr0p/exportarr - tag: v2.0.1 -persistence: - media: - nfsPath: /volume2/Storage - nfsServer: synologybond.alexlebens.net + advancedMounts: + main: + main: + - path: /mnt/store + readOnly: false postgres-16-cluster: mode: standalone cluster: