After a chat with @dduportal in Slack, I got the following conclusions (please correct me if I am wrong).
First of all I can not see the x-forwarded-for header because I am using HAProxy layer 4 so it is not possible to send headers (https://cbonte.github.io/haproxy-dconv/1.7/configuration.html#4-option%20forwardfor).
So basically the alternatives are the following:
- Use HAProxy in http mode (Layer 7) and forward the headers.
- Use metalLB and LoadBalancer type services in kubernetes (https://www.reddit.com/r/kubernetes/comments/ab7vav/access_to_onprem_kubernetes_cluster_services_from/)
- Layer 4 Load Balancing in NAT Mode (https://www.haproxy.com/blog/layer-4-load-balancing-nat-mode/)
- Or just collect the logs in HAProxy (which has the source IP) and correlate the request with the logs from traefik.
I am still unsure in which alternative I will take but whenever I take one I'll update this post with the results.
Thanks for the help.