Quantcast
Channel: The Postgres Builders Blog
Viewing all articles
Browse latest Browse all 656

How to scrape an undeclared Port on a Pod with prometheus-operator

$
0
0
Or: Why, and how, Prometheus selects Kubernetes targets to scrape. While it's not good practice, sometimes it's necessary to have Prometheus connect to a metrics port that is not declared in the Pod's manifest as an explicit Port. For example, the Pod may be managed by an operator that lacks an extensible PodTemplate. portNumber is a selector not an instruction Intuitively, you might expect to use PodMonitor's .spec.podMetricsEndpoints .portNumber setting to explicitly force the port. But this won't do what you might expect. You will instead find that all possible targets for the PodMonitor

Viewing all articles
Browse latest Browse all 656

Latest Images

Trending Articles



Latest Images