diff --git a/services/nextcloud-mail-sync/cronjob.yaml b/services/nextcloud-mail-sync/cronjob.yaml new file mode 100644 index 0000000..55a593d --- /dev/null +++ b/services/nextcloud-mail-sync/cronjob.yaml @@ -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 diff --git a/services/nextcloud-mail-sync/kustomization.yaml b/services/nextcloud-mail-sync/kustomization.yaml index cc1fa68..c349f1e 100644 --- a/services/nextcloud-mail-sync/kustomization.yaml +++ b/services/nextcloud-mail-sync/kustomization.yaml @@ -2,6 +2,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization namespace: nextcloud +resources: + - cronjob.yaml configMapGenerator: - name: nextcloud-mail-sync-script files: