apache / apisix-helm-chart

Apache APISIX Helm Chart
https://apisix.apache.org/
Apache License 2.0
218 stars 208 forks source link

help request: Difficulty Configuring APISIX for Obtaining Client IP Behind Load Balancer in OVH Kubernetes Cluster #11138 #748

Open adussarps opened 2 months ago

adussarps commented 2 months ago

Description

Issue Description: I'm currently trying to configure APISIX within an OVH Kubernetes cluster to obtain the client's real IP address behind the load balancer, similar to the setup described in the OVH documentation (link).

The OVH documentation suggests using the Proxy Protocol at the TCP layer to add the client's IP to the incoming request. However, despite attempting to replicate this setup in APISIX, I haven't been successful.

Steps Taken:

I've reviewed the OVH documentation and tried to adapt the configuration for APISIX. I've attempted to enable the Proxy Protocol in the APISIX configuration by uncommenting the relevant section in the config.yaml file and adjusting the settings.

  # proxy_protocol:                    # PROXY Protocol configuration
  #   listen_http_port: 9181           # APISIX listening port for HTTP traffic with PROXY protocol.
  #   listen_https_port: 9182          # APISIX listening port for HTTPS traffic with PROXY protocol.
  #   enable_tcp_pp: true              # Enable the PROXY protocol when stream_proxy.tcp is set.
  #   enable_tcp_pp_to_upstream: true  # Enable the PROXY protocol.

I've restarted APISIX pods after making the configuration changes.

Current Behavior: Despite enabling the Proxy Protocol in the APISIX configuration, the client's real IP address is not being correctly passed through to the application.

Additional Information:

Kubernetes Cluster Provider: OVH Apisix was setup using the helm chart.

I would appreciate any guidance or assistance on properly configuring APISIX to obtain the client's real IP address behind the load balancer in an OVH Kubernetes cluster using the Proxy Protocol.

Thank you for your help!

Environment

adussarps commented 2 months ago

I finally managed to successfully configure Apisix behind the load balancer. Here is a post with the answer to my question.

https://stackoverflow.com/questions/78294247/apisix-real-ip-behind-an-ovh-loadbalancer-kubernetes/78310956#78310956