Enable cronjobs.

This commit is contained in:
Stuart Armstrong 2025-12-08 14:10:03 +03:00
parent 6ee15ba226
commit 61be0e0405
2 changed files with 36 additions and 2 deletions

View File

@ -1,3 +1,37 @@
{{- if eq ($.Values.global.yonote_cron_calendar_events.cron_enabled | toString) "true" }}
apiVersion: batch/v1
kind: CronJob
metadata:
name: cron-calendar-events
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: cron-calendar-events
image: curlimages/curl
imagePullPolicy: IfNotPresent
envFrom:
- secretRef:
name: yonote-secrets
command:
- /bin/sh
- -c
- >-
date;
curl
-X POST
{{ .Values.global.yonote_cron_calendar_events.url }}
-H "Content-Type: application/json"
-d '
{
"token": "$(UTILS_SECRET)"
}
'
restartPolicy: OnFailure
{{- end }}
--- ---
{{- if eq ($.Values.global.yonote_cron_task_scheduler.cron_enabled | toString) "true" }} {{- if eq ($.Values.global.yonote_cron_task_scheduler.cron_enabled | toString) "true" }}
apiVersion: batch/v1 apiVersion: batch/v1

View File

@ -65,11 +65,11 @@ global:
SMTP_REQUIRE_TLS: "" SMTP_REQUIRE_TLS: ""
yonote_cron_calendar_events: yonote_cron_calendar_events:
cron_enabled: "false" cron_enabled: "true"
url: http://yonote-web/api/cron.calendar_events url: http://yonote-web/api/cron.calendar_events
yonote_cron_task_scheduler: yonote_cron_task_scheduler:
cron_enabled: "false" cron_enabled: "true"
url: http://yonote-web/api/cron.schedule url: http://yonote-web/api/cron.schedule
ingress: ingress: