I'm trying to set up a pod on public AWS NLB that will be visible only for a certain range of IPs. For this i figured I could use the security group policy from EKS.
If I come from IP 123.45.67.81
I would expect to see this in Traefik logs as my clientHost and then see the same in my end application. What happens instead is that I see Traefik's IP that is our internal network 10.X.Y.Z
. I managed to setup the NLB to pass the client IP to traefik by adding:
service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: "*",
and
spec: {
externalTrafficPolicy: Local
}
but I still can't see the IP on the final pod. I added the following to traefik's config:
- "--entryPoints.web.forwardedHeaders.trustedIPs=10.X.0.0/16"
- "--entryPoints.web.forwardedHeaders.insecure"
- "--entryPoints.web.proxyProtocol.trustedIPs=10.X.0.0/16"
- "--entryPoints.web.proxyProtocol.insecure"
- "--entryPoints.websecure.forwardedHeaders.trustedIPs=10.X.0.0/16"
- "--entryPoints.websecure.forwardedHeaders.insecure"
- "--entryPoints.websecure.proxyProtocol.trustedIPs=10.X.0.0/16"
- "--entryPoints.websecure.proxyProtocol.insecure"
but it doesn't seem to make any difference. I understand that to get this working I need to make proxy protocol work but I'm not sure why it doesn't!