I’m currently working on configuring my API Gateway, specifically Apisix in an OVH managed cluster, which I’ve deployed via Helm, to ensure that it forwards the real client IP addresses instead of the IP of the load balancer.
I found a tutorial for achieving this with a random Nginx controller here. However, I’m unsure about how to implement the same functionality with Apisix.
I noticed there’s a real-ip plugin available for Apisix. Would configuring the annotation along with this plugin be sufficient for achieving the desired behavior? If not, what additional steps or configurations would be necessary to ensure Apisix forwards the real client IP addresses?
Thank you for any assistance or guidance provided.
2
Answers
After meddling around a bit, here is the way to achieve a real-ip setup with apisix on Kubernetes in an OVH cluster.
apisix-gateway
) in your Kubernetes cluster:With this annotation, all traffic routed to your Apisix gateway will be wrapped by the proxy protocol.
configmap
object named "apisix":By following these steps, you'll be able to capture the real IP behind the OVH Kubernetes load balancer effectively.
Thank you. Troubleshooting why it was not working took too long. I always got the internal pods’ IPs only!
Finally, after I changed the config in Apisix Service it worked