From 323390b8e7b5a42810e3db62865522eb4530c98b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Mon, 2 Dec 2024 15:29:02 +0100 Subject: [PATCH] feat: add reminder cron to kontinuous --- .../preprod/templates/reminder.cronjob.yaml | 46 +++++++++++++++++++ .../prod/templates/notification.cronjob.yaml | 2 +- .../env/prod/templates/reminder.cronjob.yaml | 46 +++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 .kontinuous/env/preprod/templates/reminder.cronjob.yaml create mode 100644 .kontinuous/env/prod/templates/reminder.cronjob.yaml diff --git a/.kontinuous/env/preprod/templates/reminder.cronjob.yaml b/.kontinuous/env/preprod/templates/reminder.cronjob.yaml new file mode 100644 index 00000000..392d8fbd --- /dev/null +++ b/.kontinuous/env/preprod/templates/reminder.cronjob.yaml @@ -0,0 +1,46 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: cron-reminder +spec: + concurrencyPolicy: Forbid + successfulJobsHistoryLimit: 3 + failedJobsHistoryLimit: 3 + schedule: 15 19 * * 5 + timeZone: Europe/Paris + jobTemplate: + spec: + backoffLimit: 1 + template: + spec: + restartPolicy: Never + containers: + - name: notification + image: "{{ or .Values.registry .Values.global.registry }}/{{ .Values.global.imageProject }}/{{ .Values.global.imageRepository }}/app:{{ .Values.global.imageTag }}" + command: ["yarn", "cron-job-reminder"] + resources: + requests: + cpu: 200m + memory: 2Gi + limits: + cpu: 200m + memory: 2Gi + {{/* workingDir: /app */}} + env: + - name: PRODUCTION + value: 'true' + - name: NEXT_PUBLIC_ENV_APP + value: preproduction + - name: DATABASE_URL + value: "$(DATABASE_URL)" + - name: TZ + value: Europe/Paris + envFrom: + - configMapRef: + name: app-configmap + - secretRef: + name: pg-app + - secretRef: + name: app-sealed-secret + - secretRef: + name: carte-jeune-engage-dev-app-access-key \ No newline at end of file diff --git a/.kontinuous/env/prod/templates/notification.cronjob.yaml b/.kontinuous/env/prod/templates/notification.cronjob.yaml index 73d3cc9b..0efa3df3 100644 --- a/.kontinuous/env/prod/templates/notification.cronjob.yaml +++ b/.kontinuous/env/prod/templates/notification.cronjob.yaml @@ -17,7 +17,7 @@ spec: containers: - name: notification image: "{{ or .Values.registry .Values.global.registry }}/{{ .Values.global.imageProject }}/{{ .Values.global.imageRepository }}/app:{{ .Values.global.imageTag }}" - command: ["yarn", "cron-job"] + command: ["yarn", "cron-job-notifications"] resources: requests: cpu: 200m diff --git a/.kontinuous/env/prod/templates/reminder.cronjob.yaml b/.kontinuous/env/prod/templates/reminder.cronjob.yaml new file mode 100644 index 00000000..149b0020 --- /dev/null +++ b/.kontinuous/env/prod/templates/reminder.cronjob.yaml @@ -0,0 +1,46 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: cron-reminder +spec: + concurrencyPolicy: Forbid + successfulJobsHistoryLimit: 3 + failedJobsHistoryLimit: 3 + schedule: 15 19 * * 5 + timeZone: Europe/Paris + jobTemplate: + spec: + backoffLimit: 1 + template: + spec: + restartPolicy: Never + containers: + - name: notification + image: "{{ or .Values.registry .Values.global.registry }}/{{ .Values.global.imageProject }}/{{ .Values.global.imageRepository }}/app:{{ .Values.global.imageTag }}" + command: ["yarn", "cron-job-reminder"] + resources: + requests: + cpu: 200m + memory: 2Gi + limits: + cpu: 200m + memory: 2Gi + {{/* workingDir: /app */}} + env: + - name: PRODUCTION + value: 'true' + - name: NEXT_PUBLIC_ENV_APP + value: production + - name: DATABASE_URL + value: "$(DATABASE_URL)" + - name: TZ + value: Europe/Paris + envFrom: + - configMapRef: + name: app-configmap + - secretRef: + name: pg-app + - secretRef: + name: app-sealed-secret + - secretRef: + name: carte-jeune-engage-prod-app-access-key