titan-iac/services/nextcloud/maintenance-cronjob.yaml

67 lines
2.2 KiB
YAML
Raw Normal View History

2025-12-14 13:59:16 -03:00
# services/nextcloud/maintenance-cronjob.yaml
apiVersion: batch/v1
kind: CronJob
metadata:
name: nextcloud-maintenance
namespace: nextcloud
spec:
schedule: "30 4 * * *"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
securityContext:
runAsUser: 0
runAsGroup: 0
containers:
- name: maintenance
image: nextcloud:29-apache
imagePullPolicy: IfNotPresent
command: ["/bin/bash", "/maintenance/maintenance.sh"]
env:
- name: NC_URL
value: https://cloud.bstein.dev
- name: ADMIN_USER
valueFrom:
secretKeyRef:
name: nextcloud-admin
key: admin-user
- name: ADMIN_PASS
valueFrom:
secretKeyRef:
name: nextcloud-admin
key: admin-password
volumeMounts:
- name: nextcloud-config-pvc
mountPath: /var/www/html/config
- name: nextcloud-custom-apps
mountPath: /var/www/html/custom_apps
2026-01-07 04:41:00 -03:00
- name: nextcloud-user-data
mountPath: /var/www/html/data
2025-12-14 13:59:16 -03:00
- name: maintenance-script
mountPath: /maintenance/maintenance.sh
subPath: maintenance.sh
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
volumes:
- name: nextcloud-config-pvc
2025-12-14 13:59:16 -03:00
persistentVolumeClaim:
claimName: nextcloud-config
- name: nextcloud-custom-apps
persistentVolumeClaim:
claimName: nextcloud-custom-apps
2026-01-07 04:41:00 -03:00
- name: nextcloud-user-data
persistentVolumeClaim:
claimName: nextcloud-user-data
2025-12-14 13:59:16 -03:00
- name: maintenance-script
configMap:
name: nextcloud-maintenance-script
defaultMode: 0755