-
Notifications
You must be signed in to change notification settings - Fork 3
/
cronjob.yaml
43 lines (43 loc) · 1.61 KB
/
cronjob.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: {{ include "monitor-event-trigger.fullname" . }}
labels:
{{ include "monitor-event-trigger.labels" . | indent 4 }}
spec:
schedule: {{ .Values.schedule | quote }}
failedJobsHistoryLimit: {{ .Values.failedJobsHistoryLimit }}
successfulJobsHistoryLimit: {{ .Values.successfulJobsHistoryLimit }}
jobTemplate:
spec:
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "monitor-event-trigger.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
serviceAccountName: {{ include "monitor-event-trigger.fullname" . }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- -X
- POST
- -s
- '{{ .Values.prefixUrl }}/api/events'
- -H
- 'Content-Type: application/json; charset=UTF-8'
- -H
- 'Accept: application/json, text/javascript, */*; q=0.01'
- -H
- "Authorization: Bearer $(SDC_ACCESS_TOKEN)"
- --data-binary
- '{{ .Values.eventPayload }}'
env:
- name: SDC_ACCESS_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "monitor-event-trigger.fullname" . }}-apitoken
key: apitoken
restartPolicy: {{ .Values.restartPolicy }}