Enable prometheus metrics for controllers
@@ -22,4 +22,42 @@ spec:
selector:
matchLabels:
k8s-app: machine-api-operator
-
+---
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+ namespace: openshift-machine-api
+ name: machine-api-controllers
+ labels:
+ k8s-app: controller
+ annotations:
+ exclude.release.openshift.io/internal-openshift-hosted: "true"
+spec:
+ namespaceSelector:
+ matchNames:
+ - openshift-machine-api
+ selector:
+ matchLabels:
+ k8s-app: controller
+ endpoints:
+ - port: machine-mtrc
+ bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
+ interval: 30s
+ scheme: https
+ tlsConfig:
+ caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
+ serverName: machine-api-controllers.openshift-machine-api.svc
+ - port: machineset-mtrc
+ bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
+ interval: 30s
+ scheme: https
+ tlsConfig:
+ caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
+ serverName: machine-api-controllers.openshift-machine-api.svc
+ - port: mhc-mtrc
+ bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
+ interval: 30s
+ scheme: https
+ tlsConfig:
+ caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt
+ serverName: machine-api-controllers.openshift-machine-api.svc
