Skip to content

[prometheus-blackbox-exporter] make ServiceMonitor apiVersion configurable#6714

Open
firasmosbehi wants to merge 2 commits intoprometheus-community:mainfrom
firasmosbehi:codex/6086-blackbox-servicemonitor-api-version
Open

[prometheus-blackbox-exporter] make ServiceMonitor apiVersion configurable#6714
firasmosbehi wants to merge 2 commits intoprometheus-community:mainfrom
firasmosbehi:codex/6086-blackbox-servicemonitor-api-version

Conversation

@firasmosbehi
Copy link
Copy Markdown
Contributor

Summary

This PR adds a configurable ServiceMonitor API version for prometheus-blackbox-exporter and addresses #6086.

Problem

Some managed Kubernetes providers expose ServiceMonitor CRDs under provider-specific API groups (for example azmonitoring.coreos.com/v1). The chart currently hardcodes monitoring.coreos.com/v1, which prevents native deployment of ServiceMonitor resources in those environments.

Root cause

Both ServiceMonitor templates (servicemonitor.yaml and selfservicemonitor.yaml) hardcode apiVersion: monitoring.coreos.com/v1.

Fix

  • Added serviceMonitor.apiVersion to values with default monitoring.coreos.com/v1.
  • Updated both ServiceMonitor templates to use this value.
  • Bumped chart version from 11.8.0 to 11.8.1.

Validation

  • helm lint charts/prometheus-blackbox-exporter
  • helm template test charts/prometheus-blackbox-exporter --set serviceMonitor.enabled=true --set serviceMonitor.selfMonitor.enabled=true --set serviceMonitor.apiVersion=azmonitoring.coreos.com/v1 ...
  • Verified both rendered ServiceMonitor manifests use apiVersion: azmonitoring.coreos.com/v1.

Compatibility

Default behavior is unchanged because the new value defaults to monitoring.coreos.com/v1.

Signed-off-by: Firas Mosbehi <firas.mosbehi@insat.ucar.tn>
@firasmosbehi firasmosbehi marked this pull request as ready for review March 6, 2026 09:44
@firasmosbehi firasmosbehi changed the title [codex] [prometheus-blackbox-exporter] make ServiceMonitor apiVersion configurable [prometheus-blackbox-exporter] make ServiceMonitor apiVersion configurable Mar 6, 2026
Signed-off-by: André Bauer <monotek@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants