ingress icon indicating copy to clipboard operation
ingress copied to clipboard

How to expose /metrics to public ?

Open prakasa1904 opened this issue 2 months ago • 2 comments

I have prometheus outside of the cluster, how to expose /metrics publicly so my prome can scrape it ?

prakasa1904 avatar Oct 12 '25 08:10 prakasa1904

This is not a best practice but you may consider to create an ingress that expose the specific /metric endpoint outside..

mavimo avatar Oct 27 '25 16:10 mavimo

This is not a best practice but you may consider to create an ingress that expose the specific /metric endpoint outside..

I know it, it not best practice. It just used for local playground btw. The question is, how can I access admin port from ingress. Since, I don't see admin port is accessible publicly and there is no interface to configure admin to allow origin https://github.com/caddyserver/ingress/blob/main/pkg/store/configmap_parser.go#L14:

admin :2019 {
        origins localhost example.com sub.example.com
        enforce_origin
    }

Maybe I miss ?

prakasa1904 avatar Oct 28 '25 01:10 prakasa1904