<p>We are  running our  ms  as pod behind ALB ingress (ALB load balancer). My problem is that all of the HTTP request logs show the cluster IP address instead of the IPs of the HTTP clients. Is there any other way I can make kubernetes service to pass this info to my app servers to show the client ip address?
Even tried with java code usig get.remote.address function and still the same result.
I know there is a method &quot;service.spec.externalTrafficPolicy&quot; but this is only for GCE ad Not for AWS.
Any help!!!!!!</p>

<p>you can use Network Load Balancer with Kubernetes services, Client traffic first hits the kube-proxy on a cluster-assigned nodePort and is passed on to all the matching pods in the cluster.
When the <strong>spec.externalTrafficPolicy</strong> is set to the default value of <strong>Cluster</strong>, the incoming LoadBalancer traffic may be sent by the kube-proxy to pods on the node, or to pods on other nodes. With this configuration the client IP is sent to the kube-proxy, but when the packet arrives at the end pod, the client IP shows up as the <strong>local IP of the kube-proxy.</strong></p>
<p>By changing the <strong>spec.externalTrafficPolicy</strong> to <strong>Local</strong>, the kube-proxy will correctly forward the <strong>source IP</strong> to the end pods, but will only send traffic to pods on the node that the kube-proxy itself is running on. Kube-proxy also opens another port for the NLB health check, so traffic is only directed to nodes that have pods matching the service selector.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: nginx
  namespace: default
  labels:
    app: nginx
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-type: &quot;nlb&quot;
spec:
  externalTrafficPolicy: Local
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 80
  selector:
    app: nginx
type: LoadBalancer
</code></pre>
