<p>Let's say I have such architecture based on Java Spring Boot + Kubernetes:</p>
<ul>
<li>N pods with similar purpose (lets say: order-executors) - GROUP of pods</li>
<li>other pods with other business implementation</li>
</ul>
<p>I want to create solution where:</p>
<ol>
<li>One (central) pod can communicate with all/specific GROUP of pods to get some information about state of this pods (REST or any other way)</li>
<li>Some pods can of course be replicated i.e. x5 and central pod should communicate with all replicas</li>
</ol>
<p>Is it possible with any technology? If every order-executor pod has k8s service - there is a way to communicate with all replicas of this pod to get some info about all of them? Central pod has only service url so it doesn't know which replica pod is on the other side.</p>
<p>Is there any solution to autodiscovery every pod on cluster and communicate with them without changing any configuration? Spring Cloud? Eureka? Consul?</p>
<p>P.S.</p>
<ul>
<li>in my architecture there is also deployed etcd and rabbitmq. Maybe it can be used as part of solution?</li>
</ul>

cackoa
<p>You can use a &quot;headless Service&quot;, one with <code>clusterIP: none</code>. The result of that is when you do an DNS lookup for the normal service DNS name, instead of a single A result with the magic proxy mesh IP, you'll get separate A responses for every pod that matches the selector and is ready (i.e. the IPs that would normally be the backend). You can also fetch these from the Kubernetes API via the Endpoints type (or EndpointSlices if you somehow need to support groups with thousands, but for just 5 it would be Endpoints) using the Kubernetes Java client library. In either case, then you have a list of IPs and the rest is up to you to figure out :)</p>
