Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[prometheus-blackbox-exporter] Add selfMonitor support (#2471)
* [prometheus-blackbox-exporter] Add selfMonitor support Signed-off-by: Pavel Storozhenko <storozhenkopf@gmail.com> * [prometheus-blackbox-exporter] Add selfMonitor support Signed-off-by: Pavel Storozhenko <storozhenkopf@gmail.com> * [prometheus-blackbox-exporter] Change values structure Signed-off-by: Pavel Storozhenko <storozhenkopf@gmail.com> * [prometheus-blackbox-exporter] Fix yaml linting Signed-off-by: Pavel Storozhenko <storozhenkopf@gmail.com> Signed-off-by: Pavel Storozhenko <storozhenkopf@gmail.com>
- Loading branch information
Showing
3 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
charts/prometheus-blackbox-exporter/templates/selfservicemonitor.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{{- if .Values.serviceMonitor.selfMonitor.enabled }} | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ template "prometheus-blackbox-exporter.fullname" $ }} | ||
namespace: {{ template "prometheus-blackbox-exporter.namespace" $ }} | ||
labels: | ||
{{- include "prometheus-blackbox-exporter.labels" $ | nindent 4 }} | ||
{{- if or $.Values.serviceMonitor.selfMonitor.labels .labels }} | ||
{{- toYaml (.labels | default $.Values.serviceMonitor.selfMonitor.labels) | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
endpoints: | ||
- path: /metrics | ||
interval: {{ .interval | default $.Values.serviceMonitor.selfMonitor.interval }} | ||
scrapeTimeout: {{ .scrapeTimeout | default $.Values.serviceMonitor.selfMonitor.scrapeTimeout }} | ||
scheme: http | ||
relabelings: | ||
{{- if concat (.additionalRelabeling | default list) $.Values.serviceMonitor.selfMonitor.additionalRelabeling }} | ||
{{ toYaml (concat (.additionalRelabeling | default list) $.Values.serviceMonitor.selfMonitor.additionalRelabeling) | indent 6 }} | ||
{{- end }} | ||
jobLabel: "{{ $.Release.Name }}" | ||
selector: | ||
matchLabels: | ||
{{- include "prometheus-blackbox-exporter.selectorLabels" $ | nindent 6 }} | ||
namespaceSelector: | ||
matchNames: | ||
- {{ template "prometheus-blackbox-exporter.namespace" $ }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters