<p>I'm running a kubernetes application on GKE, which serves HTTP requests on port 80 and websocket on port 8080.</p>

<p>Now, HTTP part needs to know client's IP address, so I have to use HTTP load balancer as ingress service. Websocket part then has to use TCP load balancer, as it's clearly stated in docs that HTTP LB doesn't support it.</p>

<p>I got them both working, but on different IPs, and I need to have them on one.</p>

<p>I would expect that there is something like iptables on GCE, so I could forward traffic from port 80 to HTTP LB, and from 8080 to TCP LB, but I can't find anything like that. Anything including forwarding allows only one them.</p>

<p>I guess I could have one instance with nginx/HAproxy doing only this, but that seems like an overkill</p>

<p>Appreciate any help!</p>

<p>There's not a great answer to this right now.  Ingress objects are really HTTP only right now, and we don't really support multiple grades of ingress in a single cluster (though we want to).</p>

<p>GCE's HTTP LB doesn't do websockets yet.</p>

<p>Services have a flaw in that they lose the client IP (we are working on that). Even once we solve this, you won't be able to use GCE's L7 balancer because of the extra port you need.</p>

<p>The best workaround I can think of, and has been used by a number of users until we preserve source IP, is this:</p>

<p>Run your own haproxy or nginx or even your own app as a Daemonset on some or all nodes (label controlled) with HostPorts.</p>

<p>Run a GCE Network LB (outside of Kubernetes) pointing at the nodes with HostPorts.</p>

<p>Once we can properly preserve external IPs, you can turn this back into a plain Service.</p>
