From 651d83295f8defdd7f28ac550642197a244168a3 Mon Sep 17 00:00:00 2001 From: "nurbiy.teuchezh" Date: Fri, 3 Apr 2026 14:51:12 +0300 Subject: [PATCH] switch from cronjob to scheduler service --- yonote-chart-service/Chart.lock | 7 +- yonote-chart-service/Chart.yaml | 5 ++ yonote-chart-service/templates/cronjob.yaml | 69 ------------------ yonote-chart-service/values.yaml | 80 +++++++++++++++++++-- 4 files changed, 83 insertions(+), 78 deletions(-) delete mode 100644 yonote-chart-service/templates/cronjob.yaml diff --git a/yonote-chart-service/Chart.lock b/yonote-chart-service/Chart.lock index a59078e..c2f215e 100644 --- a/yonote-chart-service/Chart.lock +++ b/yonote-chart-service/Chart.lock @@ -14,6 +14,9 @@ dependencies: - name: app repository: https://dysnix.github.io/charts version: 0.3.15 +- name: app + repository: https://dysnix.github.io/charts + version: 0.3.15 - name: postgresql repository: https://charts.bitnami.com/bitnami version: 11.6.6 @@ -26,5 +29,5 @@ dependencies: - name: keycloak repository: https://charts.bitnami.com/bitnami version: 14.0.0 -digest: sha256:928723e189de54fafe19316743b8f9d08d7c74f9728b0c4afb1f5cd3ee1e83dc -generated: "2024-08-25T00:46:01.648512702+03:00" +digest: sha256:3b518771207ac87755784ab3e371d301474b1b8ffc969be696c6bd851c1bd73d +generated: "2026-04-03T14:38:40.532042151+03:00" diff --git a/yonote-chart-service/Chart.yaml b/yonote-chart-service/Chart.yaml index a70fa48..cfa4545 100644 --- a/yonote-chart-service/Chart.yaml +++ b/yonote-chart-service/Chart.yaml @@ -35,6 +35,11 @@ dependencies: repository: https://dysnix.github.io/charts alias: yonote-collaboration + - name: app + version: "0.3.15" + repository: https://dysnix.github.io/charts + alias: yonote-scheduler + - name: postgresql version: "11.6.6" repository: https://charts.bitnami.com/bitnami diff --git a/yonote-chart-service/templates/cronjob.yaml b/yonote-chart-service/templates/cronjob.yaml deleted file mode 100644 index 60a2763..0000000 --- a/yonote-chart-service/templates/cronjob.yaml +++ /dev/null @@ -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 }} \ No newline at end of file diff --git a/yonote-chart-service/values.yaml b/yonote-chart-service/values.yaml index 70f1645..544fed7 100644 --- a/yonote-chart-service/values.yaml +++ b/yonote-chart-service/values.yaml @@ -61,13 +61,6 @@ global: SMTP_SECURE: "" # connection will be upgraded: https://nodemailer.com/smtp/ 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: enabled: true @@ -488,6 +481,79 @@ yonote-collaboration: path: /_health 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: enabled: true global: