mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 06:57:47 +01:00
feat(deployment): add cron support
This commit is contained in:
25
7project/charts/myapp-chart/templates/cron.yaml
Normal file
25
7project/charts/myapp-chart/templates/cron.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
{{ - if .Values.cron.enabled }}
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: cronjob
|
||||
spec:
|
||||
schedule: {{ .Values.cron.schedule | quote }}
|
||||
concurrencyPolicy: {{ .Values.cron.concurrencyPolicy | quote }}
|
||||
jobTemplate:
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: cronjob
|
||||
image: curlimages/curl:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
args:
|
||||
- -sS
|
||||
- -o
|
||||
- /dev/null
|
||||
- -w
|
||||
- "%{http_code}"
|
||||
- "{{ printf "%s://%s.%s.svc.cluster.local" .Values.cron.scheme .Values.app.name .Release.Namespace | quote }}{{ .Values.cron.endpoint }}"
|
||||
restartPolicy: OnFailure
|
||||
{{ - end }}
|
||||
Reference in New Issue
Block a user