Skip to content

Commit 7ebb052

Browse files
authored
feat(kube-monitoring): adds prometheus blackbox-exporter (#630)
* feat(kube-monitoring): adds prometheus blackbox-exporter The blackbox exporter can be utilised to read Probe CRs. A Probe defines how groups of ingresses and static targets should be monitored. Signed-off-by: Richard Tief <richard.tief@sap.com> * chore(kube-monitoring): introduce ci test values Signed-off-by: Richard Tief <richard.tief@sap.com> * fix(kube-monitoring): blackbox-exporter condition Signed-off-by: Richard Tief <richard.tief@sap.com> * fix(kube-monitoring): carry over blackbox-exporter templates Signed-off-by: Richard Tief <richard.tief@sap.com> * chore(kube-monitoring): rebase onto master Signed-off-by: Richard Tief <richard.tief@sap.com> --------- Signed-off-by: Richard Tief <richard.tief@sap.com>
1 parent e77f23a commit 7ebb052

File tree

7 files changed

+53
-6
lines changed

7 files changed

+53
-6
lines changed

kube-monitoring/charts/Chart.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@ dependencies:
55
- name: kubernetes-operations
66
repository: https://cloudoperators.github.io/kubernetes-operations
77
version: 1.1.5
8-
digest: sha256:0102e656196a4054b6afdbd43c86d58e6fabff72b5bf4d859cb2cb68fb78284f
9-
generated: "2025-02-21T09:26:54.342149+01:00"
8+
- name: prometheus-blackbox-exporter
9+
repository: https://prometheus-community.github.io/helm-charts
10+
version: 9.2.0
11+
digest: sha256:f447c32ccbdebd23cd8697a871ff24841e773bef5ff4919ca414d4ad04f6f75e
12+
generated: "2025-02-21T15:04:05.862105+01:00"

kube-monitoring/charts/Chart.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ maintainers:
88
name: kube-monitoring
99
sources:
1010
- https://github.com/cloudoperators/greenhouse-extensions
11-
version: 0.25.0
11+
version: 0.25.1
1212
keywords:
1313
- operator
1414
- prometheus
@@ -21,3 +21,8 @@ dependencies:
2121
- name: kubernetes-operations
2222
repository: https://cloudoperators.github.io/kubernetes-operations
2323
version: 1.1.5
24+
- name: prometheus-blackbox-exporter
25+
alias: blackboxExporter
26+
repository: https://prometheus-community.github.io/helm-charts
27+
version: 9.2.0
28+
condition: blackboxExporter.enabled
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
blackboxExporter:
2+
enabled: true

kube-monitoring/charts/templates/_helper.tpl

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ The longest name that gets created adds and extra 37 characters, so truncation s
2323
{{- printf "%s-%s" $.Release.Name "node-exporter" | trunc 63 | trimSuffix "-" -}}
2424
{{- end -}}
2525

26+
{{- define "prometheus-blackbox-exporter.fullname" -}}
27+
{{- printf "%s-%s" $.Release.Name "blackbox-exporter" | trunc 63 | trimSuffix "-" -}}
28+
{{- end -}}
29+
2630
{{/* Generate basic labels */}}
2731
{{ define "kube-prometheus-stack.labels" }}
2832
plugindefinition: kube-monitoring
@@ -60,7 +64,7 @@ release: {{ .Release.Name }}
6064
{{- end }}
6165

6266
{{/*
63-
Common labels
67+
Common node-exporter labels
6468
*/}}
6569
{{- define "prometheus-node-exporter.labels" -}}
6670
plugindefinition: kube-monitoring
@@ -84,6 +88,31 @@ release: {{ .Release.Name }}
8488
{{- end }}
8589
{{- end }}
8690

91+
{{/*
92+
Common labels
93+
*/}}
94+
{{- define "prometheus-blackbox-exporter.labels" -}}
95+
plugindefinition: kube-monitoring
96+
plugin: {{ $.Release.Name }}
97+
{{- if .Values.global.commonLabels }}
98+
{{ tpl (toYaml .Values.global.commonLabels) . }}
99+
{{- end }}
100+
helm.sh/chart: {{ include "prometheus-blackbox-exporter.chart" . }}
101+
app.kubernetes.io/managed-by: {{ .Release.Service }}
102+
app.kubernetes.io/component: metrics
103+
app.kubernetes.io/part-of: {{ include "prometheus-blackbox-exporter.name" . }}
104+
{{ include "prometheus-node-exporter.selectorLabels" . }}
105+
{{- with .Chart.AppVersion }}
106+
app.kubernetes.io/version: {{ . | quote }}
107+
{{- end }}
108+
{{- with .Values.podLabels }}
109+
{{ toYaml . }}
110+
{{- end }}
111+
{{- if .Values.releaseLabel }}
112+
release: {{ .Release.Name }}
113+
{{- end }}
114+
{{- end }}
115+
87116
{{/* Generate basic labels */}}
88117
{{ define "kubeMonitoring.labels" }}
89118
{{- $path := index . 0 -}}

kube-monitoring/charts/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,3 +370,6 @@ testFramework:
370370
repository: cloudoperators/greenhouse-extensions-integration-test
371371
tag: main
372372
imagePullPolicy: IfNotPresent
373+
374+
blackboxExporter:
375+
enabled: false

kube-monitoring/plugindefinition.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ kind: PluginDefinition
66
metadata:
77
name: kube-monitoring
88
spec:
9-
version: 2.12.0
9+
version: 2.12.1
1010
displayName: Kubernetes monitoring
1111
description: Native deployment and management of Prometheus along with Kubernetes cluster monitoring components.
1212
docMarkDownUrl: https://raw.githubusercontent.com/cloudoperators/greenhouse-extensions/main/kube-monitoring/README.md
1313
icon: https://raw.githubusercontent.com/cloudoperators/greenhouse-extensions/main/kube-monitoring/logo.png
1414
helmChart:
1515
name: kube-monitoring
1616
repository: oci://ghcr.io/cloudoperators/greenhouse-extensions/charts
17-
version: 0.25.0
17+
version: 0.25.1
1818
options:
1919
- name: global.commonLabels
2020
description: Labels to add to all resources. This can be used to add a support group or service to all alerts.
@@ -95,3 +95,8 @@ spec:
9595
default: true
9696
required: false
9797
type: bool
98+
- name: blackboxExporter
99+
description: Deploys the Prometheus exporter for blackbox testing
100+
default: false
101+
required: false
102+
type: bool

0 commit comments

Comments
 (0)