aboutsummaryrefslogtreecommitdiffstats
path: root/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus-operator/templates/prometheus/prometheus.yaml
blob: 894b346ddb38cbb62206b41e835223a818e7d000 (plain)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
{{- if .Values.prometheus.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
  name: {{ template "prometheus-operator.fullname" . }}-prometheus
  namespace: {{ template "prometheus-operator.namespace" . }}
  labels:
    app: {{ template "prometheus-operator.name" . }}-prometheus
{{ include "prometheus-operator.labels" . | indent 4 }}
{{- if .Values.prometheus.annotations }}
  annotations:
{{ toYaml .Values.prometheus.annotations | indent 4 }}
{{- end }}
spec:
  alerting:
    alertmanagers:
{{- if .Values.prometheus.prometheusSpec.alertingEndpoints }}
{{ toYaml .Values.prometheus.prometheusSpec.alertingEndpoints | indent 6 }}
{{- else if .Values.alertmanager.enabled }}
      - namespace: {{ template "prometheus-operator.namespace" . }}
        name: {{ template "prometheus-operator.fullname" . }}-alertmanager
        port: {{ .Values.alertmanager.alertmanagerSpec.portName }}
        {{- if .Values.alertmanager.alertmanagerSpec.routePrefix }}
        pathPrefix: "{{ .Values.alertmanager.alertmanagerSpec.routePrefix }}"
        {{- end }}
        apiVersion: {{ .Values.alertmanager.apiVersion }}
{{- else }}
      []
{{- end }}
{{- if .Values.prometheus.prometheusSpec.apiserverConfig }}
  apiserverConfig:
{{ toYaml .Values.prometheus.prometheusSpec.apiserverConfig | indent 4}}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.image }}
  baseImage: {{ .Values.prometheus.prometheusSpec.image.repository }}
  version: {{ .Values.prometheus.prometheusSpec.image.tag }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.externalLabels }}
  externalLabels:
{{ toYaml .Values.prometheus.prometheusSpec.externalLabels | indent 4}}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.prometheusExternalLabelNameClear }}
  prometheusExternalLabelName: ""
{{- else if .Values.prometheus.prometheusSpec.prometheusExternalLabelName }}
  prometheusExternalLabelName: "{{ .Values.prometheus.prometheusSpec.prometheusExternalLabelName }}"
{{- end }}
{{- if .Values.prometheus.prometheusSpec.replicaExternalLabelNameClear }}
  replicaExternalLabelName: ""
{{- else if .Values.prometheus.prometheusSpec.replicaExternalLabelName }}
  replicaExternalLabelName: "{{ .Values.prometheus.prometheusSpec.replicaExternalLabelName }}"
{{- end }}
{{- if .Values.prometheus.prometheusSpec.externalUrl }}
  externalUrl: "{{ tpl .Values.prometheus.prometheusSpec.externalUrl . }}"
{{- else if and .Values.prometheus.ingress.enabled .Values.prometheus.ingress.hosts }}
  externalUrl: "http://{{ tpl (index .Values.prometheus.ingress.hosts 0) . }}{{ .Values.prometheus.prometheusSpec.routePrefix }}"
{{- else }}
  externalUrl: http://{{ template "prometheus-operator.fullname" . }}-prometheus.{{ template "prometheus-operator.namespace" . }}:{{ .Values.prometheus.service.port }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.nodeSelector }}
  nodeSelector:
{{ toYaml .Values.prometheus.prometheusSpec.nodeSelector | indent 4 }}
{{- end }}
  paused: {{ .Values.prometheus.prometheusSpec.paused }}
  replicas: {{ .Values.prometheus.prometheusSpec.replicas }}
  logLevel:  {{ .Values.prometheus.prometheusSpec.logLevel }}
  logFormat:  {{ .Values.prometheus.prometheusSpec.logFormat }}
  listenLocal: {{ .Values.prometheus.prometheusSpec.listenLocal }}
  enableAdminAPI: {{ .Values.prometheus.prometheusSpec.enableAdminAPI }}
{{- if .Values.prometheus.prometheusSpec.scrapeInterval }}
  scrapeInterval: {{ .Values.prometheus.prometheusSpec.scrapeInterval }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.evaluationInterval }}
  evaluationInterval: {{ .Values.prometheus.prometheusSpec.evaluationInterval }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.resources }}
  resources:
{{ toYaml .Values.prometheus.prometheusSpec.resources | indent 4 }}
{{- end }}
  retention: {{ .Values.prometheus.prometheusSpec.retention | quote  }}
{{- if .Values.prometheus.prometheusSpec.retentionSize }}
  retentionSize: {{ .Values.prometheus.prometheusSpec.retentionSize | quote }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.walCompression }}
  walCompression: {{ .Values.prometheus.prometheusSpec.walCompression }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.routePrefix }}
  routePrefix: {{ .Values.prometheus.prometheusSpec.routePrefix | quote  }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.secrets }}
  secrets:
{{ toYaml .Values.prometheus.prometheusSpec.secrets | indent 4 }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.configMaps }}
  configMaps:
{{ toYaml .Values.prometheus.prometheusSpec.configMaps | indent 4 }}
{{- end }}
  serviceAccountName: {{ template "prometheus-operator.prometheus.serviceAccountName" . }}
{{- if .Values.prometheus.prometheusSpec.serviceMonitorSelector }}
  serviceMonitorSelector:
{{ toYaml .Values.prometheus.prometheusSpec.serviceMonitorSelector | indent 4 }}
{{ else if .Values.prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues  }}
  serviceMonitorSelector:
    matchLabels:
      release: {{ $.Release.Name | quote }}
{{ else }}
  serviceMonitorSelector: {}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.serviceMonitorNamespaceSelector }}
  serviceMonitorNamespaceSelector:
{{ toYaml .Values.prometheus.prometheusSpec.serviceMonitorNamespaceSelector | indent 4 }}
{{ else }}
  serviceMonitorNamespaceSelector: {}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.podMonitorSelector }}
  podMonitorSelector:
{{ toYaml .Values.prometheus.prometheusSpec.podMonitorSelector | indent 4 }}
{{ else if .Values.prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues  }}
  podMonitorSelector:
    matchLabels:
      release: {{ $.Release.Name | quote }}
{{ else }}
  podMonitorSelector: {}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.podMonitorNamespaceSelector }}
  podMonitorNamespaceSelector:
{{ toYaml .Values.prometheus.prometheusSpec.podMonitorNamespaceSelector | indent 4 }}
{{ else }}
  podMonitorNamespaceSelector: {}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.remoteRead }}
  remoteRead:
{{ toYaml .Values.prometheus.prometheusSpec.remoteRead | indent 4 }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.remoteWrite }}
  remoteWrite:
{{ toYaml .Values.prometheus.prometheusSpec.remoteWrite | indent 4 }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.securityContext }}
  securityContext:
{{ toYaml .Values.prometheus.prometheusSpec.securityContext | indent 4 }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.ruleNamespaceSelector }}
  ruleNamespaceSelector:
{{ toYaml .Values.prometheus.prometheusSpec.ruleNamespaceSelector | indent 4 }}
{{ else }}
  ruleNamespaceSelector: {}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.ruleSelector }}
  ruleSelector:
{{ toYaml .Values.prometheus.prometheusSpec.ruleSelector | indent 4}}
{{- else if .Values.prometheus.prometheusSpec.ruleSelectorNilUsesHelmValues }}
  ruleSelector:
    matchLabels:
      app: {{ template "prometheus-operator.name" . }}
      release: {{ $.Release.Name | quote }}
{{ else }}
  ruleSelector: {}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.storageSpec }}
  storage:
{{ toYaml .Values.prometheus.prometheusSpec.storageSpec | indent 4 }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.podMetadata }}
  podMetadata:
{{ toYaml .Values.prometheus.prometheusSpec.podMetadata | indent 4 }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.query }}
  query:
{{ toYaml .Values.prometheus.prometheusSpec.query | indent 4}}
{{- end }}
{{- if or .Values.prometheus.prometheusSpec.podAntiAffinity .Values.prometheus.prometheusSpec.affinity }}
  affinity:
{{- if .Values.prometheus.prometheusSpec.affinity }}
{{ toYaml .Values.prometheus.prometheusSpec.affinity | indent 4 }}
{{- end }}
{{- if eq .Values.prometheus.prometheusSpec.podAntiAffinity "hard" }}
    podAntiAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
      - topologyKey: {{ .Values.prometheus.prometheusSpec.podAntiAffinityTopologyKey }}
        labelSelector:
          matchLabels:
            app: prometheus
            prometheus: {{ template "prometheus-operator.fullname" . }}-prometheus
{{- else if eq .Values.prometheus.prometheusSpec.podAntiAffinity "soft" }}
    podAntiAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          topologyKey: {{ .Values.prometheus.prometheusSpec.podAntiAffinityTopologyKey }}
          labelSelector:
            matchLabels:
              app: prometheus
              prometheus: {{ template "prometheus-operator.fullname" . }}-prometheus
{{- end }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.tolerations }}
  tolerations:
{{ toYaml .Values.prometheus.prometheusSpec.tolerations | indent 4 }}
{{- end }}
{{- if .Values.global.imagePullSecrets }}
  imagePullSecrets:
{{ toYaml .Values.global.imagePullSecrets | indent 4 }}
{{- end }}
{{- if or .Values.prometheus.prometheusSpec.additionalScrapeConfigs .Values.prometheus.prometheusSpec.additionalScrapeConfigsExternal }}
  additionalScrapeConfigs:
    name: {{ template "prometheus-operator.fullname" . }}-prometheus-scrape-confg
    key: additional-scrape-configs.yaml
{{- end }}
{{- if .Values.prometheus.prometheusSpec.additionalAlertManagerConfigs }}
  additionalAlertManagerConfigs:
    name: {{ template "prometheus-operator.fullname" . }}-prometheus-am-confg
    key: additional-alertmanager-configs.yaml
{{- end }}
{{- if .Values.prometheus.prometheusSpec.additionalAlertRelabelConfigs }}
  additionalAlertRelabelConfigs:
    name: {{ template "prometheus-operator.fullname" . }}-prometheus-am-relabel-confg
    key: additional-alert-relabel-configs.yaml
{{- end }}
{{- if .Values.prometheus.prometheusSpec.containers }}
  containers:
{{ toYaml .Values.prometheus.prometheusSpec.containers | indent 4 }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.initContainers }}
  initContainers:
{{ toYaml .Values.prometheus.prometheusSpec.initContainers | indent 4 }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.priorityClassName }}
  priorityClassName: {{ .Values.prometheus.prometheusSpec.priorityClassName }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.thanos }}
  thanos:
{{ toYaml .Values.prometheus.prometheusSpec.thanos | indent 4 }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.disableCompaction }}
  disableCompaction: {{ .Values.prometheus.prometheusSpec.disableCompaction }}
{{- end }}
  portName: {{ .Values.prometheus.prometheusSpec.portName }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.enforcedNamespaceLabel }}
  enforcedNamespaceLabel: {{ .Values.prometheus.prometheusSpec.enforcedNamespaceLabel }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.volumes }}
  volumes:
{{ toYaml .Values.prometheus.prometheusSpec.volumes | indent 4 }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.volumeMounts }}
  volumeMounts:
{{ toYaml .Values.prometheus.prometheusSpec.volumeMounts | indent 4 }}
{{- end }}