Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #901 from Truxnell/Truxnell/issue258
Browse files Browse the repository at this point in the history
Add trash-updator - #258
  • Loading branch information
truxnell authored Apr 4, 2022
2 parents 4b9ebcc + 9f380d9 commit 080416b
Show file tree
Hide file tree
Showing 5 changed files with 177 additions and 1 deletion.
19 changes: 18 additions & 1 deletion k8s/clusters/hegira/flux/orchestration/organizarrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ spec:
sourceRef:
kind: GitRepository
name: home-cluster

---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
Expand All @@ -184,3 +183,21 @@ spec:
sourceRef:
kind: GitRepository
name: home-cluster
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: organizarrs-trash-updater
namespace: flux-system
spec:
dependsOn:
- name: organizarrs-namespace
- name: organizarrs-sonarr
- name: organizarrs-radarr
interval: 5m
path: "./k8s/manifests/organizarrs/trash-updater"
prune: true
wait: true
sourceRef:
kind: GitRepository
name: home-cluster
85 changes: 85 additions & 0 deletions k8s/manifests/organizarrs/trash-updater/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: trash-updater
namespace: organizarrs
labels:
app: trash-updater
spec:
schedule: "0 3 * * *"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
automountServiceAccountToken: false

initContainers:
- name: render-config
image: ghcr.io/k8s-at-home/trash-updater:v1.8.2
env:
- name: RADARR_API_KEY
valueFrom:
secretKeyRef:
name: trash-updater-secrets
key: radarrApiKey
- name: SONARR_API_KEY
valueFrom:
secretKeyRef:
name: trash-updater-secrets
key: sonarrApiKey
command:
- "/bin/bash"
- -c
args:
- "envsubst < /config/trash.yaml > /shared/trash.yaml"
volumeMounts:
- name: config
mountPath: /config
- name: shared
mountPath: /shared

containers:
- name: trash-updater-sonarr
image: ghcr.io/k8s-at-home/trash-updater:v1.8.2
imagePullPolicy: IfNotPresent
env:
- name: TZ
value: "${TIMEZONE}"
command:
- /app/trash
args:
- sonarr
- --config
- /config/trash.yaml
volumeMounts:
- name: shared
mountPath: /config
readOnly: true

- name: trash-updater-radarr
image: ghcr.io/k8s-at-home/trash-updater:v1.8.2
imagePullPolicy: IfNotPresent
env:
- name: TZ
value: "${TIMEZONE}"
command:
- /app/trash
args:
- radarr
- --config
- /config/trash.yaml
volumeMounts:
- name: shared
mountPath: /config
readOnly: true

restartPolicy: OnFailure

volumes:
- name: config
configMap:
name: trash-updater-config
- name: shared
emptyDir: {}
15 changes: 15 additions & 0 deletions k8s/manifests/organizarrs/trash-updater/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: downloads
resources:
- secret.sops.yaml
- cronjob.yaml
configMapGenerator:
- name: trash-updater-config
files:
- trash.yaml
generatorOptions:
disableNameSuffixHash: true
annotations:
kustomize.toolkit.fluxcd.io/substitute: disabled
9 changes: 9 additions & 0 deletions k8s/manifests/organizarrs/trash-updater/secret.sops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: trash-updater-secrets
namespace: organizarrs
stringData:
radarrApiKey: 81b871ddf3d24beb9d832eec2f951727
sonarrApiKey: 55a99987569d40448bd9e1f47614b4c1
50 changes: 50 additions & 0 deletions k8s/manifests/organizarrs/trash-updater/trash.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# For more details on the configuration, see the Configuration Reference on the wiki here:
# https://github.com/rcdailey/trash-updater/wiki/Configuration-Reference

# Configuration specific to Sonarr
sonarr:
- base_url: http://sonarr.organizarrs:8989
api_key: ${SONARR_API_KEY}

quality_definition: series

release_profiles:
- type: series

# Configuration specific to Radarr.
radarr:
- base_url: http://radarr.organizarrs:7878
api_key: ${RADARR_API_KEY}

quality_definition:
type: movie

delete_old_custom_formats: true

custom_formats:
- names:
- 3D
- 5.1 Surround
- BR-DISK
- DV
- EVO (no WEBDL)
- HDR
- HDR (undefined)
- HQ-Remux
- HQ-WEBDL
- LQ
- No-RlsGroup
- Repack/Proper
- Special Edition
- Theatrical Cut
- x265 (720/1080p)
quality_profiles:
- name: HD-1080p

- names:
- Multi
quality_profiles:
- name: HD-1080p
score: -10000
- name: Ultra-HD
score: -10000

0 comments on commit 080416b

Please sign in to comment.