k3s-cluster/kubernetes/main/apps/download/mylar3/cache-cronjob.yaml

33 lines
881 B
YAML
Raw Normal View History

2023-04-09 02:53:04 +00:00
apiVersion: batch/v1
kind: CronJob
metadata:
name: clear-mylar3-cache
namespace: download
spec:
# 4am every day
schedule: "0 4 * * *"
2023-04-09 02:57:57 +00:00
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 2
2023-04-09 02:53:04 +00:00
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