Add cronjob to clear mylar3 cache

This commit is contained in:
SeanOMik 2023-04-08 22:53:04 -04:00
parent a9785e696d
commit 6b6e7210e6
Signed by: SeanOMik
GPG Key ID: 568F326C7EB33ACB
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,31 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: clear-mylar3-cache
namespace: download
spec:
# 4am every day
schedule: "0 4 * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: clear-mylar3-cache
image: frolvlad/alpine-bash
imagePullPolicy: IfNotPresent
command:
- /bin/bash
- -c
- find /config/mylar/cache/* -maxdepth 1 ! -name "*.jpg" -delete
volumeMounts:
- name: mylar3-config
mountPath: /config
securityContext:
runAsNonRoot: true
runAsUser: 1000
restartPolicy: OnFailure
volumes:
- name: mylar3-config
hostPath:
path: /mnt/MainPool/Kubernetes/mylar3

View File

@ -2,3 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- ./helm-release.yaml - ./helm-release.yaml
- ./cache-cronjob.yaml