-
Bug
-
Resolution: Done-Errata
-
Normal
-
None
-
4.13, 4.12, 4.14
Description of problem:
Injecting ServiceMonitor CR's having invalid syntax on the proxyUrl attribute will not be valdidated and rejected but will break reloading and restarting of Prometheus due to possible invalid syntax.
Version-Release number of selected component (if applicable):
4.12.x 4.13.x 4.14.x
How reproducible:
always
Steps to Reproduce:
1. Inject custom ServiceMonitor CR with an invalid proxyUrl (example: 'http://xxx-${STAGE}.svc.cluster.local:80')
Complete CR
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: servicemonitor
namespace: xxxx
spec:
endpoints:
- path: /actuator/prometheus-text
port: http-web
proxyUrl: 'http://xxx-${STAGE}.svc.cluster.local:80'
relabelings:
- action: labeldrop
regex: pod
- action: drop
regex: destination
sourceLabels:
- reporter
- action: drop
regex: ^envoy_.*
sourceLabels:
- __name__
selector:
matchLabels:
monitored: prometheus
Actual results:
ts=2024-03-13T13:42:47.471Z caller=main.go:928 level=error msg="Error reloading config" err="couldn't load configuration (--config.file=\"/etc/prometheus/config_out/prometheus.env.yaml\"): parsing YAML file /etc/prometheus/config_out/prometheus.env.yaml: parse \http://XXXX-${STAGE}.svc.cluster.local:80\: invalid character \"{\" in host name"
Expected results:
successful reload
Additional info:
- blocks
-
OCPBUGS-36719 [release-4.15] ServiceMonitor proxyUrl validation missing which breaks reload and restart of Prometheus
- Closed
- is cloned by
-
OCPBUGS-36719 [release-4.15] ServiceMonitor proxyUrl validation missing which breaks reload and restart of Prometheus
- Closed
- links to
-
RHEA-2024:0041 OpenShift Container Platform 4.16.z bug fix update