-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to access prometheus from custom service #790
Comments
What are you trying to achieve?
What ns is this? |
Sorry I've now updated the issue a bit more since I first posted it, adding details on the curl. I am trying to run an app with integrated visualisations based on the prometheus data. But the problem I'm hitting seems to be with any call to this service from within the cluster as I'm also unable to run the curl from within openshift-monitoring. That 10.130.0.11 is also what a ping resolves to, though in the failed curls it then moves on to I notice there's a way to hook a grafana into this prometheus. In my case the tool isn't grafana but I'm wondering if I should be able to connect in a similar way. But I'm hoping I don't have to deal with auth as I'm just calling from the backend inside the cluster. I was expecting to be able to call the service in the same way in the cluster as when port-forwarding. Quite confused about what I could be missing. |
Oh just noticed the prometheus-operated services doesn't have a ClusterIP. I guess that's why. I guess I should be using the prometheus-k8s service instead. That one requires auth but I can curl it from in the cluster when I add a token header. So I should be able to go that route and add the token. Will try that and re-open if I hit problems with that. |
I am trying to query the prometheus-operated service in the openshift-monitoring namespace. When I port-forward and call from postman I am able to get data:
But when I make the same call from inside the cluster I get a connection refused error:
Here I am calling from a namespace in an istio mesh but I can't see any NetworkPolicy blocking this access and from what I've read it should be accessible by default.
I've exported a curl from postman and that also works locally and gives
connection refused
when run from inside the Pod (I've installed curl and done an exec into the Pod) toprometheus-operated.openshift-monitoring
. So it's an access problem and not a problem with the call being run. This Pod is able to make calls to other namespaces, seemingly just not this particular service.I've also deployed a curler Pod to the openshift-monitoring namespace and the curl from inside that gives connection refused too. From there I see
Any idea what could be blocking this?
The text was updated successfully, but these errors were encountered: