1
0
Fork 0
home-stack-kustomize/kustomize/bases/nextcloud/previewgenerator-cronjob.yaml

36 lines
1.2 KiB
YAML
Raw Normal View History

2023-06-14 04:42:12 +00:00
apiVersion: batch/v1
kind: CronJob
metadata:
name: previewgenerator-cron
labels:
app.kubernetes.io/name: nextcloud
app.kubernetes.io/component: previewgenerator
spec:
schedule: "3,13,23,33,43,53 * * * *"
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
jobTemplate:
metadata:
labels:
app.kubernetes.io/name: nextcloud
app.kubernetes.io/component: previewgenerator
spec:
backoffLimit: 0 # no retry
2023-09-22 04:48:09 +00:00
ttlSecondsAfterFinished: 86400
2023-06-14 04:42:12 +00:00
template:
metadata:
labels:
app.kubernetes.io/name: nextcloud
app.kubernetes.io/component: previewgenerator
spec:
restartPolicy: Never
serviceAccountName: server-cron
containers:
- name: run-previewgenerator-cron
image: bitnami/kubectl
command: ["/bin/bash"]
args:
- -xc
2023-06-16 21:10:34 +00:00
- kubectl exec "$(kubectl get pods -l 'app.kubernetes.io/component=server' -o name)" -- /bin/bash -c '( if ! which sudo &>/dev/null; then apt update && apt install sudo; fi ) && sudo -u www-data php -f /var/www/html/occ preview:pre-generate'