<p>I deploy Prometheus server with 2 replicas on AKS (Azure's kubernetes) with the following config.</p>
<pre><code>apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
  name: prometheus
  namespace: monitoring
  ...

spec:
  podMetadata:
  version: v2.13.1
  replicas: 2
  retention: 1d
  ...
</code></pre>
<p>So I will have 2 prometheus server pods on my cluster.
<a href="https://i.stack.imgur.com/TRlf1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TRlf1.png" alt="enter image description here" /></a></p>
<p>And then I expose this application with loadbalancer.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: prometheus
  namespace: monitoring
spec:
  type: LoadBalancer
  ports:
  - port: 80
    targetPort: 9090
  selector:
    app: prometheus
</code></pre>
<p><a href="https://i.stack.imgur.com/PuR9g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PuR9g.png" alt="enter image description here" /></a></p>
<p>Everything work successfully here, however, how could I know which promethus pod is exposed by loadbalancer?
It seems only one prometheus pod is exposed by loadbalancer.</p>

Ricky Parker
<p>If you have more than one replica of a pod all the pod replica's IPs are added as <code>Endpoints</code> to the service <code>prometheus</code>. So when traffic comes to the LoadBalancer it forwards it to the <code>prometheus</code> service IP which load balances the traffic and sends to one of the replica pods.</p>
<p>To check Endpoints of the service use below command</p>
<pre><code>kubectl describe svc prometheus -n monitoring
</code></pre>
<p>If you see multiple IPs in the <code>Endpoints</code> section using  above command that essentially means that all those replica POD IPs are exposed by the service.</p>
