joe-elliott / cert-exporter

A Prometheus exporter that publishes cert expirations on disk and in Kubernetes secrets
Apache License 2.0
321 stars 87 forks source link

Add Service Monitor To Kustomize App Example #38

Closed abhishekjiitr closed 4 years ago

joe-elliott commented 4 years ago

Thank you for the contribution! Unfortunately right now the kustomize example already has this file

https://github.com/joe-elliott/cert-exporter/blob/master/docs/examples/custom-secrets/prometheus-scrape.yaml

which is showing how to manually configure prometheus to scrape cert exporter.

Can you add some comments in the readme about why you would use one approach or the other? i.e. manually configuring it vs. using the prometheus operator

joe-elliott commented 4 years ago

Nice. Thanks!

abhishekjiitr commented 4 years ago

The core idea of the Prometheus Operator is to decouple deployment of Prometheus instances from the configuration of which entities they are monitoring. For that purpose only custom resources like ServiceMonitor were introduced, where instead of changing Prometheus config itself you can dynamically add scrape targets using ServiceMonitors.

This ultimately improves the UX of a person using these configs. Instead of manually making changes in his/her prometheus config, he can just plug-and-play.