nextcloud-mail-sync: manage CronJob via Flux

This commit is contained in:
Brad Stein 2026-01-03 07:03:43 -03:00
parent b06dcb2263
commit a76d944433
2 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,69 @@
# services/nextcloud-mail-sync/cronjob.yaml
apiVersion: batch/v1
kind: CronJob
metadata:
name: nextcloud-mail-sync
namespace: nextcloud
spec:
schedule: "0 5 * * *"
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 1
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
securityContext:
runAsUser: 0
runAsGroup: 0
containers:
- name: mail-sync
image: nextcloud:29-apache
imagePullPolicy: IfNotPresent
command:
- /bin/bash
- /sync/sync.sh
env:
- name: KC_BASE
value: https://sso.bstein.dev
- name: KC_REALM
value: atlas
- name: KC_ADMIN_USER
valueFrom:
secretKeyRef:
name: nextcloud-keycloak-admin
key: username
- name: KC_ADMIN_PASS
valueFrom:
secretKeyRef:
name: nextcloud-keycloak-admin
key: password
- name: MAILU_DOMAIN
value: bstein.dev
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
volumeMounts:
- name: nextcloud-app
mountPath: /var/www/html
- name: nextcloud-user-data
mountPath: /data/userdata
- name: sync-script
mountPath: /sync/sync.sh
subPath: sync.sh
volumes:
- name: nextcloud-app
persistentVolumeClaim:
claimName: nextcloud-app
- name: nextcloud-user-data
persistentVolumeClaim:
claimName: nextcloud-user-data
- name: sync-script
configMap:
name: nextcloud-mail-sync-script
defaultMode: 0755

View File

@ -2,6 +2,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: nextcloud
resources:
- cronjob.yaml
configMapGenerator:
- name: nextcloud-mail-sync-script
files: