I have AKS with nginx load balancer (ingress controller) installed with helm as the entry point to my cluster.
I want to preserve the real IP addresses from clients for further whitelisting with nginx.ingress.kubernetes.io/whitelist-source-range
on certain paths of specific services.
I found the solution here:
nginx ingress controller forward source ip
which works, but also I found in certain blogs and in the Kubernetes documentation, that setting externalTrafficPolicy=Local is not good for proper load balancing.
I tried to set different variations of settings to my nginx configmap, but with no luck. I also found, that it can be done somehow with X-Forwarded-For header, but I couldn't resolve it.