2026-01-03 07:03:43 -03:00
|
|
|
# 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
|
2026-01-06 10:02:50 -03:00
|
|
|
- name: POSTGRES_HOST
|
|
|
|
|
value: postgres-service.postgres.svc.cluster.local
|
|
|
|
|
- name: POSTGRES_DB
|
|
|
|
|
valueFrom:
|
|
|
|
|
secretKeyRef:
|
|
|
|
|
name: nextcloud-db
|
|
|
|
|
key: database
|
|
|
|
|
- name: POSTGRES_USER
|
|
|
|
|
valueFrom:
|
|
|
|
|
secretKeyRef:
|
|
|
|
|
name: nextcloud-db
|
|
|
|
|
key: db-username
|
|
|
|
|
- name: POSTGRES_PASSWORD
|
|
|
|
|
valueFrom:
|
|
|
|
|
secretKeyRef:
|
|
|
|
|
name: nextcloud-db
|
|
|
|
|
key: db-password
|
2026-01-03 07:03:43 -03:00
|
|
|
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
|