<p>I am trying to write a utility which accepts following parameters -</p>

<ol>
<li>kubernetes service name </li>
<li>spring boot actuator endpoint name (e.g. /actuator/loggers)</li>
</ol>

<p>This utility should invoke the endpoint on all the pods of this service. </p>

<p>Currently I am obtaining the name of all the pods through service name and iterating over all of them and meeting the requirement by running -</p>

<pre><code>`kubectl exec $pod -- curl http:\\localhost:8081\actuator\loggers`
</code></pre>

<p>Though it works, I am looking for a solution where I don't have to do "exec" on the pod as I am not sure of the permission the user may have who runs this utility. Is there any way to make http call to individual pods?</p>

<p>I would run this utility inside the kubernetes cluster, and expose this utility to the developers that need the data. That way you only have to expose this utility, rather than exposing all the pods to allow http calls. I think it's much simpler this way.</p>

<p>There are different ways to expose a Kubernetes Pod to outside the cluster, but I'd recommend <a href="https://medium.com/microservices-for-net-developers/exposing-your-application-to-the-public-ingress-c628c922e78b" rel="nofollow noreferrer">using Ingress</a>, which uses a nginx proxy to route traffic coming from outside to your pod.</p>
