-
Notifications
You must be signed in to change notification settings - Fork 418
/
cost-analyzer-checks-template.yaml
70 lines (70 loc) · 2.4 KB
/
cost-analyzer-checks-template.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{{- if .Values.kubecostChecks -}}
{{- if .Values.kubecostChecks.enabled -}}
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: cost-analyzer-checks
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
spec:
{{- if .Values.kubecostChecks.debug }}
schedule: "*/1 * * * *"
{{- else if .Values.kubecostChecks.schedule }}
schedule: {{ .Values.kubecostChecks.schedule | quote }}
{{- else }}
schedule: "*/10 * * * *"
{{- end }}
jobTemplate:
metadata:
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 8 }}
spec:
template:
spec:
containers:
- name: cost-analyzer-checks
{{- if .Values.kubecostChecks }}
image: {{ .Values.kubecostChecks.image }}:prod-{{ $.Chart.AppVersion }}
{{- else }}
image: gcr.io/kubecost1/checks:prod-{{ $.Chart.AppVersion }}
{{ end }}
imagePullPolicy: Always
args:
- node
- ./node/cron.js
resources:
{{ toYaml .Values.kubecostChecks.resources | indent 14 }}
env:
- name: COST_ANALYZER_SERVER_ENDPOINT
value: {{ template "cost-analyzer.serviceName" . }}.{{ .Release.Namespace }}:9001
- name: COST_ANALYZER_MODEL_ENDPOINT
{{- if .Values.saml.enabled }}
value: {{ template "cost-analyzer.serviceName" . }}.{{ .Release.Namespace }}:9004
{{- else }}
value: {{ template "cost-analyzer.serviceName" . }}.{{ .Release.Namespace }}:9003
{{ end }}
{{- if .Values.kubecostChecks }}
{{- if .Values.kubecostChecks.debug }}
- name: SEND_UPDATES_NOW
value: "true"
{{- end }}
{{- end }}
- name: PROMETHEUS_ALERTMANAGER_ENDPOINT
valueFrom:
configMapKeyRef:
name: {{ template "cost-analyzer.fullname" . }}
key: prometheus-alertmanager-endpoint
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 12 }}
{{- end }}
restartPolicy: OnFailure
securityContext:
runAsNonRoot: true
runAsUser: 1001
{{- end -}}
{{- end -}}