feat: add trash updater jobs

This commit is contained in:
auricom
2021-05-10 09:58:41 +02:00
parent 477d97fd13
commit 4b2fef43bf
7 changed files with 163 additions and 2 deletions

View File

@@ -2,4 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- helm-release.yaml
- trash-updater-config.yaml
- trash-updater-job.yaml
- volume.yaml

View File

@@ -0,0 +1,26 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: radarr-trash-updater-config
namespace: media
data:
trash.yaml: |
# A starter config to use with Trash Updater. Most values are set to "reasonable defaults".
# Update the values below as needed for your instance. You will be required to update the
# API Key and URL for each instance you want to use.
#
# Many optional settings have been omitted to keep this template simple.
#
# 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 Radarr.
radarr:
# Set the URL/API Key to your actual instance
- base_url: http://radarr:7878
api_key: ${SECRET_RADARR_API_KEY}
# Which quality definition in the guide to sync to Radarr. Only choice right now is 'movie'
quality_definition:
type: movie

View File

@@ -0,0 +1,48 @@
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: radarr-trash-updater
namespace: media
spec:
schedule: "@weekly"
jobTemplate:
spec:
template:
metadata:
name: radarr-trash-updater
spec:
serviceAccountName: jobs
imagePullSecrets:
- name: regcred
containers:
- name: trash-updater
image: registry.${SECRET_CLUSTER_DOMAIN}/homelab/home-cluster-jobs:1.0.0
imagePullPolicy: Always
env:
- name: DOTNET_SYSTEM_GLOBALIZATION_INVARIANT
value: "1"
command:
- "bin/sh"
- "-ec"
- |
#!/bin/sh
set -o nounset
set -o errexit
cd /tmp
curl --location https://github.com/rcdailey/trash-updater/releases/latest/download/trash-linux-x64.zip --output ./trash.zip
unzip trash.zip
chmod 755 trash
./trash radarr --config /opt/trash.yaml
volumeMounts:
- name: config
mountPath: /opt/trash.yaml
subPath: trash.yaml
volumes:
- name: config
configMap:
name: radarr-trash-updater-config
restartPolicy: Never

View File

@@ -2,4 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- helm-release.yaml
- trash-updater-config.yaml
- trash-updater-job.yaml
- volume.yaml

View File

@@ -0,0 +1,34 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: sonarr-trash-updater-config
namespace: media
data:
trash.yaml: |
# A starter config to use with Trash Updater. Most values are set to "reasonable defaults".
# Update the values below as needed for your instance. You will be required to update the
# API Key and URL for each instance you want to use.
#
# Many optional settings have been omitted to keep this template simple.
#
# 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:
# Set the URL/API Key to your actual instance
- base_url: http://sonarr:8989
api_key: ${SECRET_SONARR_API_KEY}
# Quality definitions from the guide to sync to Sonarr. Choice: anime, series, hybrid
quality_definition: series
# Release profiles from the guide to sync to Sonarr. Types: anime, series
# You can optionally add tags and make negative scores strictly ignored
release_profiles:
- type: series
filter:
include_optional: true
tags:
- tv

View File

@@ -0,0 +1,47 @@
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: sonarr-trash-updater
namespace: media
spec:
schedule: "@weekly"
jobTemplate:
spec:
template:
metadata:
name: sonarr-trash-updater
spec:
serviceAccountName: jobs
imagePullSecrets:
- name: regcred
containers:
- name: trash-updater
image: registry.${SECRET_CLUSTER_DOMAIN}/homelab/home-cluster-jobs:1.0.0
env:
- name: DOTNET_SYSTEM_GLOBALIZATION_INVARIANT
value: "1"
command:
- "bin/sh"
- "-ec"
- |
#!/bin/sh
set -o nounset
set -o errexit
cd /tmp
curl --location https://github.com/rcdailey/trash-updater/releases/latest/download/trash-linux-x64.zip --output ./trash.zip
unzip trash.zip
chmod 755 trash
./trash sonarr --config /opt/trash.yaml
volumeMounts:
- name: config
mountPath: /opt/trash.yaml
subPath: trash.yaml
volumes:
- name: config
configMap:
name: sonarr-trash-updater-config
restartPolicy: Never

View File

@@ -59,8 +59,10 @@ stringData:
SECRET_PGADMIN_EMAIL: ENC[AES256_GCM,data:qYFHru7/Uc99zCuthuV6AUR5nZsnbw==,iv:amNQTp4E81/oeJY5S42jzabVlHaSXAGx2FCDJMdxF7Q=,tag:DJ6+YuXMQiA7vxZOI/4e3Q==,type:str]
SECRET_PGADMIN_PASSWORD: ENC[AES256_GCM,data:Vde194icfO2EEKMYLBI=,iv:j2Oc7KQkbF04flcy/Ocnxi03AzksBDRiOg8AwNSw0WU=,tag:klpDtxsR7bL4saA3W387Hg==,type:str]
SECRET_POSTGRESQL_KUBE_POSTGRES_PASSWORD: ENC[AES256_GCM,data:4nCHYL9GOmQVL8a8ChrSbw==,iv:VAz+tQemtU6uxD+kVwqoF3AEgBb0VZ143BrTEGBboN8=,tag:oXJLCfK1keOSL3lE7IS+dQ==,type:str]
SECRET_RADARR_API_KEY: ENC[AES256_GCM,data:ZeFPwBChccnPaAYt7BeddOztsskuetGs+9JnTr6IMQk=,iv:OLM255cq+OKJ36oJau25CkuPP6lgRPncSYCF8ZheGIs=,tag:zXjtc+p+PGZQNQJSHrmBZw==,type:str]
SECRET_RECIPES_DB_PASSWORD: ENC[AES256_GCM,data:xrGotJzNqXy1lV8x5E1gTw==,iv:Hq4upOt2IDgZj9k83KiFa0xOQDxwVZj+J2DeMbtvJ8Q=,tag:37cUjvjXr4PWmsgYRJbe8A==,type:str]
SECRET_RECIPES_SECRET_KEY: ENC[AES256_GCM,data:PIvlJPnXVSS6nZQWWIVbWg==,iv:g1Q8NLAANO0EfnDV0Uo5VFh/LHKzBRCaYkCe7VfJaDo=,tag:xib4FFYHHa3mQM/2WT3O3g==,type:str]
SECRET_SONARR_API_KEY: ENC[AES256_GCM,data:IZFC4mZNCWFPlhZLW+KuBi/qROFhHJ7Py71a5BuUaUs=,iv:FIU1XG94JkzRjAUOhL1siMe8yWVZhcWa74QT61R1FhQ=,tag:YKIcbI3F1/GoNTrXcUCv8g==,type:str]
SECRET_SHARRY_DB_PASSWORD: ENC[AES256_GCM,data:0Go2Il1BESQeIqO4bkQ=,iv:oTjVEdJ2V/s+52hpwCQ4frb4Lhj1O3piQYJW31FtHuc=,tag:XjVfj105rDldWsjbNe6hKg==,type:str]
SECRET_SHARRY_JDBC_URL: ENC[AES256_GCM,data:Ae/6McZQi+C2tobgkCMzCX0KRWPMH/g8bN5AHBRx0UppS7P0i0OsnvrsnJKqkkIRwlPPZVkPaK9Hb11cXa0zM5742n0f,iv:mqDu5fzP2Zi4YqlQwbvomdPUryPk/xiaN70YJIh/iKU=,tag:8GY7qpdObFqYbOE5VXnMRQ==,type:str]
SECRET_SEARX_MORTY_KEY: ENC[AES256_GCM,data:/zX3pPAImKRtf5ydmSY/xDUXX52wIQCK/zGm2tpiguKrC3E9OVkkAvM4lSQ=,iv:1qWPlEXePDKlEEl+wQ+/qJspNEkAJNYjx7ouKEbWfkY=,tag:4Eyf4qQGiSliixJnZs2pSQ==,type:str]
@@ -78,8 +80,8 @@ sops:
azure_kv: []
hc_vault: []
age: []
lastmodified: "2021-05-06T22:42:56Z"
mac: ENC[AES256_GCM,data:SSTfjttioy0yYWW37NWuwYEoz6qjzvkTsjFawvQbX13zZDZusDkYnSWO3Oxf8WYwjdiugmPvs3O4PidnyKxDq6ebfotMswuev2yo94mrqqI/744xizt6VC66KeTh6kvzb4OwO3GipckFR9PoLjytKpAbm1NBI7YHXFRACWE/ACQ=,iv:moAA76H6uqJfBTjznxDqODD1wodCz65yQYDST/7iJJ0=,tag:B6M1ASYYh4N0t3rf0zxCTA==,type:str]
lastmodified: "2021-05-10T07:50:10Z"
mac: ENC[AES256_GCM,data:GYrJxU4JeO1HlUd01Bc1oUmq+IgUcx+5z6GJ40lNdlf0kKm5w97f8jN+f6B7aWm39zlKG9KaErCQwTw5ZCvFFWuvmKdh3RI7uzbkcW9bSA/cMCzVZMBkfBDVuYqMl09LGJSaq8vkDdkTSFENCInHOT7V4dn1w657BKuCX4IswUw=,iv:b3YB9NgFjcxbOvPA1KRMZ2FJfnWX7CwclEG7kxJYzpI=,tag:YX1bruBkpGzXVJXE70hXLg==,type:str]
pgp:
- created_at: "2021-04-19T23:03:06Z"
enc: |