|
|
@@ -0,0 +1,35 @@
|
|
|
+apiVersion: batch/v1
|
|
|
+kind: CronJob
|
|
|
+metadata:
|
|
|
+ name: nextcloud-cron
|
|
|
+ namespace: nextcloud # Asegúrate de que este es el mismo namespace de tu Nextcloud
|
|
|
+spec:
|
|
|
+ schedule: "*/5 * * * *" # Se ejecuta cada 5 minutos
|
|
|
+ concurrencyPolicy: Forbid # Evita que se acumulen ejecuciones si una se retrasa
|
|
|
+ successfulJobsHistoryLimit: 2
|
|
|
+ failedJobsHistoryLimit: 3
|
|
|
+ jobTemplate:
|
|
|
+ spec:
|
|
|
+ template:
|
|
|
+ spec:
|
|
|
+ restartPolicy: OnFailure
|
|
|
+ containers:
|
|
|
+ - name: nextcloud-cron
|
|
|
+ image: nextcloud:34.0.3-apache # Usa la misma etiqueta (tag) que tu pod principal
|
|
|
+ imagePullPolicy: IfNotPresent
|
|
|
+ command:
|
|
|
+ - /usr/local/bin/php
|
|
|
+ - -f
|
|
|
+ - /var/www/html/cron.php
|
|
|
+ securityContext:
|
|
|
+ runAsUser: 33 # Obliga a ejecutarlo como el usuario www-data
|
|
|
+ runAsGroup: 33
|
|
|
+ volumeMounts:
|
|
|
+ - name: server-storage
|
|
|
+ mountPath: /var/www/html
|
|
|
+ subPath: server-data
|
|
|
+ volumes:
|
|
|
+ - name: server-storage
|
|
|
+ persistentVolumeClaim:
|
|
|
+ claimName: dbnc-pv-claim
|
|
|
+
|