<p>I explain my case.</p>

<p>I have three pods running in my Kubernetes.
In one pod, there is a Flask framework running. In the two other pods, there is a Java application with a REST API. ( The Java application is the same on the two pods ).</p>

<p>My pod with Flask has to ask the two pods with the Java application <strong>individually</strong> using HTTP requests.</p>

<p>I have created a service that points toward my two pods with Java Application.
When my pod with Flask uses the service to ask the two others, I just have one response.</p>

<p>How could I target my pods individually ? Is it possible in my case to get endpoints from the pod with Flask ? I could have x pods with my Java Application.</p>

<p>Best regards,</p>

<p>Nico.</p>

<p>IMO, the right way to do this is to have 3 <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">deployments</a> each managing your pods individually each with a <code>replica</code> of <code>1</code>.</p>

<ul>
<li>One for your Flask app</li>
<li>One for your Java app</li>
<li>Another one for the same Java app. </li>
</ul>

<p>If the Java apps are the only ones that you need to connect to from the Flask app you can expose those deployments with 2 different <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">services</a> that will manage the endpoints. Services are supposed to manage the endpoints unless you are trying to connect to an <a href="https://kubernetes.io/docs/concepts/services-networking/service/#services-without-selectors" rel="nofollow noreferrer">external</a> endpoint.</p>
