Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions helm/templates/opava-stats-mailer-cronjob.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
{{- range $cron := .Values.cronjob.opava.crons }}
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: opava-stats-emailer
name: opava-stats-emailer-{{$cron.id}}
labels:
{{- include "helm.labels" . | nindent 4 }}
{{- include "helm.labels" $ | nindent 4 }}
spec:
# Run at 10:00 AM on 31st of January and 31st of July
schedule: "0 10 31 1,7 *"
schedule: "0 10 {{$cron.day}} {{$cron.month}} *"
startingDeadlineSeconds: 3600
concurrencyPolicy: Forbid
failedJobsHistoryLimit: 1
successfulJobsHistoryLimit: 3
jobTemplate:
metadata:
labels:
{{- include "helm.selectorLabels" . | nindent 8 }}
{{- include "helm.selectorLabels" $ | nindent 8 }}
spec:
activeDeadlineSeconds: 7200
template:
spec:
restartPolicy: OnFailure
containers:
- name: opava-stats-emailer
image: "{{ .Values.image.repository }}/moocfi-backend:{{ .Values.image.tag | default .Chart.AppVersion }}"
image: "{{ $.Values.image.repository }}/moocfi-backend:{{ $.Values.image.tag | default $.Chart.AppVersion }}"
command: ["sh", "-c", "npm run opava-stats-emailer"]
envFrom:
- secretRef:
Expand All @@ -33,3 +34,4 @@ spec:
secretKeyRef:
name: new-redis
key: redis-password
{{- end }}
11 changes: 11 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,14 @@ cronjob:
- id: "1"
day: 13
month: 6
opava: # @slu.cz report, see backend/bin/opavaStatsEmailer.ts
crons:
- id: "0"
day: 31
month: 1
- id: "1"
day: 31
month: 7
- id: "2"
day: 13
month: 5
Loading