<p>I have deployed a java application (backend) in openshift, and i have spun up 3 pods backend-1-abc, backend-1-xyz and backend-1-def. </p>

<p>How can I get the list of all the pod names for this service "backend"? Is it possible to obtain it programatically or is there any endpoint exposed in openshift to obtain this?</p>

Pramod S
<p>Are you saying you have actually created three separate Pod definitions with those names? Are you not using a DeploymentConfig or StatefulSet?</p>

<p>If you were using StatefulSet the names would be predictable.</p>

<p>Either way, the Pods would usually be set up with labels and could use a command like:</p>

<pre><code>oc get pods --selector app=myappname
</code></pre>

<p>Perhaps have a read of:</p>

<ul>
<li><a href="https://www.openshift.com/deploying-to-openshift/" rel="nofollow noreferrer">https://www.openshift.com/deploying-to-openshift/</a></li>
</ul>

<p>It touches on labelling and querying based on labels.</p>

<p>Please provide more details about how you are creating the deployment if want more details/options.</p>
