[prometheus-blackbox-exporter] make ServiceMonitor apiVersion configurable#6714
Open
firasmosbehi wants to merge 2 commits intoprometheus-community:mainfrom
Open
Conversation
Signed-off-by: Firas Mosbehi <firas.mosbehi@insat.ucar.tn>
monotek
requested changes
Mar 10, 2026
Signed-off-by: André Bauer <monotek@users.noreply.github.com>
monotek
approved these changes
Mar 10, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a configurable ServiceMonitor API version for
prometheus-blackbox-exporterand addresses #6086.Problem
Some managed Kubernetes providers expose ServiceMonitor CRDs under provider-specific API groups (for example
azmonitoring.coreos.com/v1). The chart currently hardcodesmonitoring.coreos.com/v1, which prevents native deployment of ServiceMonitor resources in those environments.Root cause
Both ServiceMonitor templates (
servicemonitor.yamlandselfservicemonitor.yaml) hardcodeapiVersion: monitoring.coreos.com/v1.Fix
serviceMonitor.apiVersionto values with defaultmonitoring.coreos.com/v1.11.8.0to11.8.1.Validation
helm lint charts/prometheus-blackbox-exporterhelm template test charts/prometheus-blackbox-exporter --set serviceMonitor.enabled=true --set serviceMonitor.selfMonitor.enabled=true --set serviceMonitor.apiVersion=azmonitoring.coreos.com/v1 ...apiVersion: azmonitoring.coreos.com/v1.Compatibility
Default behavior is unchanged because the new value defaults to
monitoring.coreos.com/v1.