diff --git a/cluster/apps/download/mylar3/cache-cronjob.yaml b/cluster/apps/download/mylar3/cache-cronjob.yaml new file mode 100644 index 0000000..74a665d --- /dev/null +++ b/cluster/apps/download/mylar3/cache-cronjob.yaml @@ -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 \ No newline at end of file diff --git a/cluster/apps/download/mylar3/kustomization.yaml b/cluster/apps/download/mylar3/kustomization.yaml index ea3145d..ebd0b6f 100644 --- a/cluster/apps/download/mylar3/kustomization.yaml +++ b/cluster/apps/download/mylar3/kustomization.yaml @@ -1,4 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- ./helm-release.yaml \ No newline at end of file +- ./helm-release.yaml +- ./cache-cronjob.yaml \ No newline at end of file