Add cronjob to clear mylar3 cache
This commit is contained in:
parent
a9785e696d
commit
6b6e7210e6
|
@ -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
|
|
@ -2,3 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
|||
kind: Kustomization
|
||||
resources:
|
||||
- ./helm-release.yaml
|
||||
- ./cache-cronjob.yaml
|
Loading…
Reference in New Issue