availability_cronjob.yaml 3.2 KB
Newer Older
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
44
45
46
{{- if .Values.cerebrum.availabilityChecker.enabled -}}
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: {{ .Release.Name }}-availibilty-checker
  labels:
    app: {{ template "hifiscp.name" . }}-availibilty-checker
    chart: {{ template "hifiscp.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
  schedule: "{{ .Values.cerebrum.availabilityChecker.schedule }}"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: availibilty-checker
            image: {{ .Values.cerebrum.availabilityChecker.image.repository }}:{{ .Values.cerebrum.availabilityChecker.image.tag }}
            imagePullPolicy: {{ .Values.cerebrum.availabilityChecker.image.pullPolicy }}
            env:
            {{- if .Values.cerebrum.config.mongodb.database }}
            - name: MONGODB_DATABASE
              value: {{ .Values.cerebrum.config.mongodb.database | quote }}
            {{- end }}
            {{- if .Values.cerebrum.config.mongodb.host }}
            - name: MONGODB_HOST
              value: {{ .Values.cerebrum.config.mongodb.host | quote }}
            {{- end }}
            {{- if .Values.cerebrum.config.mongodb.port }}
            - name: MONGODB_PORT
              value: {{ .Values.cerebrum.config.mongodb.port | quote }}
            {{- end }}
            {{- if .Values.cerebrum.config.mongodb.authdb }}
            - name: MONGODB_AUTHDB
              value: {{ .Values.cerebrum.config.mongodb.authdb | quote }}
            {{- end }}
            {{- if .Values.cerebrum.config.mongodb.username }}
            - name: MONGODB_USERNAME
              value: {{ .Values.cerebrum.config.mongodb.username | quote }}
            {{- end }}
            - name: MONGODB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: {{ template "hifiscp.fullname" . }}-mongodb-credentials
                  key: mongodb-password
Thomas Beermann's avatar
Thomas Beermann committed
47
            {{- if .Values.cerebrum.availabilityChecker.esHost }}
48
            - name: ES_HOST
Thomas Beermann's avatar
Thomas Beermann committed
49
              value: {{ .Values.cerebrum.availabilityChecker.esHost | quote }}
50
            {{- end }}
Thomas Beermann's avatar
Thomas Beermann committed
51
            {{- if .Values.cerebrum.availabilityChecker.esPort }}
52
            - name: ES_PORT
Thomas Beermann's avatar
Thomas Beermann committed
53
              value: {{ .Values.cerebrum.availabilityChecker.esPort | quote }}
54
            {{- end }}
Thomas Beermann's avatar
Thomas Beermann committed
55
            {{- if .Values.cerebrum.availabilityChecker.esIndexpattern }}
56
            - name: ES_INDEXPATTERN
Thomas Beermann's avatar
Thomas Beermann committed
57
              value: {{ .Values.cerebrum.availabilityChecker.esIndexpattern | quote }}
58
            {{- end }}
Thomas Beermann's avatar
Thomas Beermann committed
59
            {{- if .Values.cerebrum.availabilityChecker.esUseSsl }}
60
            - name: ES_USE_SSL
Thomas Beermann's avatar
Thomas Beermann committed
61
              value: {{ .Values.cerebrum.availabilityChecker.esUseSsl | quote }}
62
63
64
            {{- end }}
            - name: ES_RELEASE
              value: {{ .Release.Name }}
Thomas Beermann's avatar
Thomas Beermann committed
65
            {{- if .Values.cerebrum.availabilityChecker.username }}
66
            - name: ES_USERNAME
Thomas Beermann's avatar
Thomas Beermann committed
67
              value: {{ .Values.cerebrum.availabilityChecker.username | quote }}
68
69
70
71
72
73
            {{- end }}
            - name: ES_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: {{ template "hifiscp.fullname" . }}-es-credentials
                  key: es-password
74
75
          restartPolicy: OnFailure
{{ end }}