Up until recently, I was running two separate Prometheus instances – one on a Raspberry Pi, and the other in my k3s cluster using kube-prometheus-stack. I wanted to unify them, ideally to simplify management and version control. The challenge here is in how to manage the scrape targets for out-of-cluster resources.
Thanks to my friend Justin, I was able to use a much more elegant solution.
Options
The basic way
When deploying kube-prometheus-stack
, define additionalScrapeConfigs
. Since I deployed via the Helm chart, that would mean doing a helm upgrade
each time I needed to change things. Gross.
Continue reading