switch from cronjob to scheduler service

This commit is contained in:
Нурбий Теучеж 2026-04-03 14:51:12 +03:00
parent f3f0c36b6b
commit 651d83295f
4 changed files with 83 additions and 78 deletions

View File

@ -14,6 +14,9 @@ dependencies:
- name: app - name: app
repository: https://dysnix.github.io/charts repository: https://dysnix.github.io/charts
version: 0.3.15 version: 0.3.15
- name: app
repository: https://dysnix.github.io/charts
version: 0.3.15
- name: postgresql - name: postgresql
repository: https://charts.bitnami.com/bitnami repository: https://charts.bitnami.com/bitnami
version: 11.6.6 version: 11.6.6
@ -26,5 +29,5 @@ dependencies:
- name: keycloak - name: keycloak
repository: https://charts.bitnami.com/bitnami repository: https://charts.bitnami.com/bitnami
version: 14.0.0 version: 14.0.0
digest: sha256:928723e189de54fafe19316743b8f9d08d7c74f9728b0c4afb1f5cd3ee1e83dc digest: sha256:3b518771207ac87755784ab3e371d301474b1b8ffc969be696c6bd851c1bd73d
generated: "2024-08-25T00:46:01.648512702+03:00" generated: "2026-04-03T14:38:40.532042151+03:00"

View File

@ -35,6 +35,11 @@ dependencies:
repository: https://dysnix.github.io/charts repository: https://dysnix.github.io/charts
alias: yonote-collaboration alias: yonote-collaboration
- name: app
version: "0.3.15"
repository: https://dysnix.github.io/charts
alias: yonote-scheduler
- name: postgresql - name: postgresql
version: "11.6.6" version: "11.6.6"
repository: https://charts.bitnami.com/bitnami repository: https://charts.bitnami.com/bitnami

View File

@ -1,69 +0,0 @@
{{- 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" }}
apiVersion: batch/v1
kind: CronJob
metadata:
name: cron-task-scheduler
spec:
schedule: "0 */1 * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: cron-task-scheduler
image: curlimages/curl
imagePullPolicy: IfNotPresent
envFrom:
- secretRef:
name: yonote-secrets
command:
- /bin/sh
- -c
- >-
date;
curl
-X POST
{{ .Values.global.yonote_cron_task_scheduler.url }}
-H "Content-Type: application/json"
-d '
{
"token":"$(UTILS_SECRET)", "limit":"200"
}
'
restartPolicy: OnFailure
{{- end }}

View File

@ -61,13 +61,6 @@ global:
SMTP_SECURE: "" # connection will be upgraded: https://nodemailer.com/smtp/ SMTP_SECURE: "" # connection will be upgraded: https://nodemailer.com/smtp/
SMTP_REQUIRE_TLS: "" SMTP_REQUIRE_TLS: ""
yonote_cron_calendar_events:
cron_enabled: "true"
url: http://yonote-web/api/cron.calendar_events
yonote_cron_task_scheduler:
cron_enabled: "true"
url: http://yonote-web/api/cron.schedule
ingress: ingress:
enabled: true enabled: true
@ -488,6 +481,79 @@ yonote-collaboration:
path: /_health path: /_health
port: app port: app
yonote-scheduler:
fullnameOverride: yonote-scheduler
nameOverride: yonote-scheduler
name: scheduler
image:
registry: images.updates.yonote.ru
repository: yonote
tag: 1.19.8
pullPolicy: IfNotPresent
command: ["/bin/sh", "-c"]
args: ['IS_COMPILED=true yarn bytenode ./build/server/main.jsc --services=scheduler']
replicaCount: 1
maxReplicas: 1
minReplicas: 1
resources:
limits:
cpu: 250m
memory: 512Mi
requests:
cpu: 150m
memory: 128Mi
checksums: null
containerPorts:
- containerPort: 3000
name: app
protocol: TCP
service:
type: ClusterIP
port: 80
targetPort: app
envFrom:
- configMapRef:
name: yonote-configs
- secretRef:
name: yonote-secrets
podLabels:
redis-client: 'true'
podAnnotations:
checksum/configmap: "{{ toJson .Values.global.yonote.config.plain | sha256sum }}"
checksum/secret: "{{ toJson .Values.global.yonote.config.secret | sha256sum }}"
readinessProbe:
enabled: true
failureThreshold: 6
initialDelaySeconds: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
httpGet:
path: /_health
port: app
livenessProbe:
enabled: true
failureThreshold: 6
initialDelaySeconds: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
httpGet:
path: /_health
port: app
yonoteDatabase: yonoteDatabase:
enabled: true enabled: true
global: global: