<p>I manage 3 Pods through Deployment and connect through NodePort of Service.<br />
I wonder which pod the service load balanced whenever I connect from outside.<br />
It's hard to check with Pods log, can I find out through the event or kubectl command?</p>

H.jenny
<p>I am not sure if this is exactly what you're looking for, but you can use <a href="https://istio.io/latest/docs/concepts/observability/#distributed-traces" rel="nofollow noreferrer">Istio</a> to generate detailed telemetry for all service communications.</p>
<p>You may be particularly interested in <a href="https://istio.io/latest/docs/concepts/observability/#distributed-traces" rel="nofollow noreferrer">Distributed tracing</a>:</p>
<blockquote>
<p>Istio generates distributed trace spans for each service, providing operators with a detailed understanding of call flows and service dependencies within a mesh.</p>
</blockquote>
<p>By using distributed tracing, you are able to monitor every requests as they flow through a mesh.<br />
More information about Distributed Tracing with Istio can be found in the <a href="https://istio.io/latest/faq/distributed-tracing/" rel="nofollow noreferrer">FAQ on Distributed Tracing</a> documentation.<br />
Istio supports multiple tracing backends (e.g. <a href="https://www.jaegertracing.io/" rel="nofollow noreferrer">Jaeger</a>).</p>
<p>Jaeger is a distributed tracing system similar to <a href="https://zipkin.io/" rel="nofollow noreferrer">OpenZipkin</a> and as we can find in the <a href="https://www.jaegertracing.io/" rel="nofollow noreferrer">jaegertracing documentation</a>:</p>
<blockquote>
<p>It is used for monitoring and troubleshooting microservices-based distributed systems, including:</p>
<ul>
<li>Distributed context propagation</li>
<li>Distributed transaction monitoring</li>
<li>Root cause analysis</li>
<li>Service dependency analysis</li>
<li>Performance / latency optimization</li>
</ul>
</blockquote>
<p>Of course, you don't need to install Istio to use Jaeger, but you'll have to instrument your application so that trace data from different parts of the stack are sent to Jaeger.</p>
<hr />
<p>I'll show you how you can use Jaeger to monitor a sample request.</p>
<p>Suppose I have an <code>app-1</code> <code>Deployment</code> with three <code>Pods</code> exposed using the <code>NodePort</code> service.</p>
<pre><code>$ kubectl get pod,deploy,svc
NAME                                        READY   STATUS    RESTARTS   AGE   IP           
app-1-7ddf4f77c6-g682z                      2/2     Running   0          25m   10.60.1.11   
app-1-7ddf4f77c6-smlcr                      2/2     Running   0          25m   10.60.0.7    
app-1-7ddf4f77c6-zn7kh                      2/2     Running   0          25m   10.60.2.5    

NAME                                       READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/app-1                      3/3     3            3           21m

NAME                                         TYPE           CLUSTER-IP    EXTERNAL-IP      PORT(S)                      AGE
service/app-1                                NodePort       10.64.0.88    &lt;none&gt;           80:30881/TCP                 25m
</code></pre>
<p>Additionally, I deployed <code>jaeger</code> (with <code>istio</code>):</p>
<pre><code>$ kubectl get deploy -n istio-system | grep jaeger
jaeger                 1/1     1            1           67m
</code></pre>
<p>To check if Jaeger is working as expected, I will try to connect to this <code>app-1</code> application from outside the cluster (using the <code>NodePort</code> service):</p>
<pre><code>$ curl &lt;PUBLIC_IP&gt;:30881
app-1
</code></pre>
<p>Let's find this trace with Jaeger:</p>
<p><a href="https://i.stack.imgur.com/TdFlR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TdFlR.png" alt="enter image description here" /></a></p>
<p>As you can see, we can easily find out which Pod has received our request.</p>
