Metallb: Feature Request: Supporting Proxy Protocol v2

Created on 6 Jan 2021  路  2Comments  路  Source: metallb/metallb

Hi everyone!

Problem

It's not possible to preserve source IP (client IP) when service.spec.externalTrafficPolicy is set to Cluster.

Current Workaround

The current workaround is setting service.spec.externalTrafficPolicy to Local. But it has its own limitations:

  1. The incoming traffic not balanced (when some pods are running on the same node)
  2. IP of all worker nodes should be advertised with BGP and it increases the number of records of the routing table in the routers. Also, some routers have limitations for load-balancing the traffic between nodes more than X (16?) nodes.

Alternative solution: using Proxy Protocol v2 for TCP or UDP traffic:

What is "proxy protocol v2"?

https://developers.cloudflare.com/spectrum/proxy-protocol

Which LB providers have already implemented this feature?

Implementation Ideas

Unfortunately, I'm not familiar with the code base of metallb, but I've investigated a little bit and I guess we can use mmproxy (from cloudflare) or go-mmproxy (from path.net) and deploy it as a sidecar to the speaker pods, but it's just a guess and I don't know the details. Also, there might be other options as well.

Most helpful comment

Hi @alibo @m-yosefpor

A better way to preserve sourceIP is to use a CNI that support Direct Server Return, see #796.
MetalLB is controlplane only, making it part of the dataplane means we would be responsible for the performance of the system, so more bugs to fight, I personally don't see that happening.
Also Calico will soon be able to annonce LoadBalancers IP via BGP https://github.com/metallb/metallb/issues/114#issuecomment-754839513.

All 2 comments

+1 . That feature would be really nice to have.

Hi @alibo @m-yosefpor

A better way to preserve sourceIP is to use a CNI that support Direct Server Return, see #796.
MetalLB is controlplane only, making it part of the dataplane means we would be responsible for the performance of the system, so more bugs to fight, I personally don't see that happening.
Also Calico will soon be able to annonce LoadBalancers IP via BGP https://github.com/metallb/metallb/issues/114#issuecomment-754839513.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

theothermike picture theothermike  路  5Comments

danderson picture danderson  路  7Comments

berlinsaint picture berlinsaint  路  4Comments

russellb picture russellb  路  4Comments

runningman84 picture runningman84  路  6Comments