<p>Currently I am having an issue with one of my services set to be a load balancer. I am trying to get the source ip preservation like its stated in the <a href="https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip" rel="nofollow noreferrer">docs</a>. However when I set the <code>externalTrafficPolicy</code> to local I lose all traffic to the service. Is there something I'm missing that is causing this to fail like this?</p>

<p><strong>Load Balancer Service:</strong></p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  labels:
    app: loadbalancer
    role: loadbalancer-service
  name: lb-test
  namespace: default
spec:
  clusterIP: 10.3.249.57
  externalTrafficPolicy: Local
  ports:
  - name: example service
    nodePort: 30581
    port: 8000
    protocol: TCP
    targetPort: 8000
  selector:
    app: loadbalancer-example
    role: example
  type: LoadBalancer
status:
  loadBalancer:
    ingress:
    - ip: *example.ip*
</code></pre>

Pablo Marti Cordero
<p>Could be several things. A couple of suggestions:</p>

<ol>
<li>Your service is getting an external IP and doesn't know how to reply back based on the local IP address of the pod.

<ul>
<li>Try running a sniffer on your pod see if you are getting packets from the external source.</li>
<li>Try checking at logs of your application.</li>
</ul></li>
<li>Healthcheck in your load balancer is failing. Check the load balancer for your service on GCP console.

<ul>
<li>Check the instance port is listening. (probably not if your health check is failing)</li>
</ul></li>
</ol>

<p><a href="https://i.stack.imgur.com/mZULU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mZULU.png" alt="lb"></a></p>

<p>Hope it helps.</p>
