fix(serviceMonitor): bind the port always to the port of the service
Some checks failed
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is failing

This commit is contained in:
Markus Pesch 2024-11-26 19:59:11 +01:00
parent bb4a5d48b4
commit 1d061fe95f
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982
3 changed files with 2 additions and 8 deletions

View File

@ -26,7 +26,7 @@ spec:
{{- end }}
scrapeTimeout: {{ required "The scrape timeout of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.scrapeTimeout }}
scheme: {{ required "The scheme of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.scheme}}
targetPort: {{ required "The port of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.port }}
targetPort: {{ required "The port of the service is not defined!" .Values.services.http.port }}
{{- with .Values.prometheus.metrics.serviceMonitor.tlsConfig }}
tlsConfig:
{{- toYaml . | nindent 6 }}

View File

@ -134,7 +134,6 @@ tests:
action: "drop"
prometheus.metrics.serviceMonitor.scrapeTimeout: "5s"
prometheus.metrics.serviceMonitor.scheme: "http"
prometheus.metrics.serviceMonitor.port: 10443
asserts:
- hasDocuments:
count: 1
@ -166,7 +165,4 @@ tests:
value: 5s
- equal:
path: spec.endpoints[0].scheme
value: http
- equal:
path: spec.endpoints[0].targetPort
value: 10443
value: http

View File

@ -332,7 +332,6 @@ prometheus:
## @param prometheus.metrics.serviceMonitor.honorLabels Honor labels.
## @param prometheus.metrics.serviceMonitor.interval Interval at which metrics should be scraped. If not specified Prometheus' global scrape interval is used.
## @param prometheus.metrics.serviceMonitor.path HTTP path for scraping prometheus metrics.
## @param prometheus.metrics.serviceMonitor.port HTTP port for scraping prometheus metrics.
## @param prometheus.metrics.serviceMonitor.relabelings RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields.
## @param prometheus.metrics.serviceMonitor.scrapeTimeout Timeout after which the scrape is ended. If not specified, global Prometheus scrape timeout is used.
## @param prometheus.metrics.serviceMonitor.scheme HTTP scheme to use for scraping. For example `http` or `https`.
@ -347,7 +346,6 @@ prometheus:
honorLabels: false
interval: "60s"
path: "/metrics"
port: 9187
relabelings: []
scrapeTimeout: "30s"
scheme: "http"