I have a python program that fetches the client IP using request.client.host headers and Fast API.
This program is running on a kubernetes pod(ip-pod).
I have another Gateway API implemented using KrakenD and this runs on another pod in kubernetes cluster.
The Kubernetes yaml files for both(ip-pod and KrakenD) have the property externalTrafficPolicy: Local
I am unable to retrieve the real IP of the user and this could be because KrakenD is not allowing the real IP to reach to the ip-pod.
I have tested the program by exposing the ip-pod to the internet using type: LoadBalancer and that way it gives the correct client IP. But when I use the KrakenD gateway, the IP is something different(private IP).