Skip to content

Commit 83fa57f

Browse files
committed
Use scrapeClass for service monitors
As documented in [1], the platform Prometheus servers are configured with a scrape class named `tls-client-certificate-auth` which automatically injects the client certificate and key files for mutual TLS into the scrape configuration of the service. This commit also removes the `namespaceSelector` field of the service monitors: it isn't required when the service monitor and service are located in the same namespace. It also adjusts the `jobLabel` value to refer to the `app` label of the service. [1] https://rhobs-handbook.netlify.app/products/openshiftmonitoring/collecting_metrics.md/#configuring-prometheus-to-scrape-metrics Signed-off-by: Simon Pasquier <[email protected]>
1 parent 0357803 commit 83fa57f

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

manifests/0000_90_etcd-operator_03_servicemonitor.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,13 @@ metadata:
88
include.release.openshift.io/single-node-developer: "true"
99
spec:
1010
endpoints:
11-
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
12-
interval: 30s
11+
- interval: 30s
1312
port: https
1413
scheme: https
1514
tlsConfig:
16-
caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
1715
serverName: metrics.openshift-etcd-operator.svc
18-
certFile: /etc/prometheus/secrets/metrics-client-certs/tls.crt
19-
keyFile: /etc/prometheus/secrets/metrics-client-certs/tls.key
20-
jobLabel: component
21-
namespaceSelector:
22-
matchNames:
23-
- openshift-etcd-operator
16+
jobLabel: app
17+
scrapeClass: tls-client-certificate-auth
2418
selector:
2519
matchLabels:
2620
app: etcd-operator

0 commit comments

Comments
 (0)