Skip to content

Commit

Permalink
Merge branch 'feat/midarr'
Browse files Browse the repository at this point in the history
  • Loading branch information
axeII committed Jan 25, 2024
2 parents 82bdf8b + f01a129 commit 70d8a6f
Show file tree
Hide file tree
Showing 6 changed files with 178 additions and 0 deletions.
1 change: 1 addition & 0 deletions kubernetes/apps/media/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ resources:
- ./kapowarr/ks.yaml
- ./kaizoku/ks.yaml
- ./recyclarr/ks.yaml
- ./midarr/ks.yaml
44 changes: 44 additions & 0 deletions kubernetes/apps/media/midarr/app/externalsecret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/axeII/crds/main/externalsecret_v1beta1.json
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: midarr
namespace: media
spec:
secretStoreRef:
kind: ClusterSecretStore
name: onepassword-connect
target:
name: midarr-secret
creationPolicy: Owner
template:
engineVersion: v2
data:
# App
SETUP_ADMIN_EMAIL: "{{ .SETUP_ADMIN_EMAIL }}"
SETUP_ADMIN_NAME: "{{ .SETUP_ADMIN_NAME }}"
SETUP_ADMIN_PASSWORD: "{{ .SETUP_ADMIN_PASSWORD }}"
RADARR_API_KEY: "{{ .RADARR__API_KEY }}"
SONARR_API_KEY: "{{ .SONARR__API_KEY }}"
DB_HOSTNAME: &dbHost postgresql.database.svc.cluster.local
DB_DATABASE: &dbName midarr
DB_USERNAME: &dbUser "{{ .DB_USERNAME }}"
DB_PASSWORD: &dbPass "{{ .DB_PASSWORD }}"
# Postgres Init
INIT_POSTGRES_DBNAME: *dbName
INIT_POSTGRES_HOST: *dbHost
INIT_POSTGRES_USER: *dbUser
INIT_POSTGRES_PASS: *dbPass
INIT_POSTGRES_SUPER_PASS: "{{ .POSTGRES_SUPER_PASS }}"
dataFrom:
- extract:
key: midarr
- extract:
key: cloudnative-pg
- extract:
key: radarr
property: RADARR__API_KEY
- extract:
key: sonarr
property: SONARR__API_KEY
22 changes: 22 additions & 0 deletions kubernetes/apps/media/midarr/app/gatus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: midarr-gatus-ep
namespace: monitoring
labels:
gatus.io/enabled: "true"
data:
config.yaml: |
endpoints:
- name: midarr
url: https://midarr.${SECRET_DOMAIN}
group: media
interval: 1m
conditions: ["[STATUS] == 200"]
client:
dns-resolver: udp://192.168.69.106:53
alerts:
- type: discord
description: "healthcheck failed"
send-on-resolved: true
82 changes: 82 additions & 0 deletions kubernetes/apps/media/midarr/app/helmrelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: midarr
namespace: media
spec:
interval: 30m
chart:
spec:
chart: app-template
version: 1.5.1
sourceRef:
kind: HelmRepository
name: bjw-s-charts
namespace: flux-system
maxHistory: 2
install:
createNamespace: true
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
retries: 3
uninstall:
keepHistory: false
values:
initContainers:
01-init-db:
image: ghcr.io/onedr0p/postgres-init:14.8
imagePullPolicy: IfNotPresent
envFrom:
- secretRef:
name: midarr-secret
controller:
replicas: 2
strategy: RollingUpdate
annotations:
reloader.stakater.com/auto: "true"
image:
repository: ghcr.io/midarrlabs/midarr-server
tag: v4.2.0@sha256:b368f94a8a7e0657125da108129ffbdc92d04fc7fba302ea88d9396b125b4d03
env:
TZ: ${TIMEZONE}
APP_URL: http://midarr.media.svc.cluster.local:4000
RADARR_BASE_URL: radarr.media.svc.cluster.local
SONARR_BASE_URL: sonarr.media.svc.cluster.local
envFrom:
- secretRef:
name: midarr-secret
service:
main:
ports:
http:
port: 4000
ingress:
main:
enabled: true
ingressClassName: nginx
annotations:
hajimari.io/icon: mdi:play-circle-outline
hosts:
- host: &host "{{ .Release.Name }}.${SECRET_DOMAIN}"
paths:
- path: /
pathType: Prefix
tls:
- hosts:
- *host
persistence:
nfs-nas-media:
enabled: true
existingClaim: media-nfs-share-pvc
mountPath: /media
readOnly: true
resources:
requests:
cpu: 100m
memory: 250Mi
limits:
memory: 1000Mi
7 changes: 7 additions & 0 deletions kubernetes/apps/media/midarr/app/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
- ./externalsecret.yaml
- ./gatus.yaml
22 changes: 22 additions & 0 deletions kubernetes/apps/media/midarr/ks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: cluster-apps-midarr
namespace: flux-system
spec:
dependsOn:
- name: cluster-apps-ingress-nginx
path: ./kubernetes/apps/media/midarr/app
prune: true
sourceRef:
kind: GitRepository
name: home-kubernetes
healthChecks:
- apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
name: midarr
namespace: media
interval: 30m
retryInterval: 1m
timeout: 3m

0 comments on commit 70d8a6f

Please sign in to comment.