Skip to main content

Enable the PROXY protocol

What the PROXY protocol does​

A load balancer in front of the cluster sends each request to an ingress controller. The ingress controller then sees the address of the load balancer, not the address of the client. The PROXY protocol adds the client address to the connection, so that the ingress controller and your applications can see it.

The load balancer and the ingress controller must use the same setting. If only one of them uses the PROXY protocol, the requests fail.

note

With the EKSCluster provider, SD enables the PROXY protocol on the AWS load balancers and in the NGINX and HAProxy ingress controllers. You do not have to do the steps on this page.

Enable the PROXY protocol in the ingress controller​

SD has no configuration field for the PROXY protocol. Add it to the configuration of the ingress controller with a custom patch.

  1. Enable the PROXY protocol on your load balancer. See the documentation of your load balancer.

  2. Create a patch file for the ConfigMap of your ingress controller. The name of the ConfigMap changes with the type of the controller: single has one ConfigMap, dual has one for the internal and one for the external controller. For dual, create one patch file for each ConfigMap.

    The proxy-protocol key accepts the PROXY protocol only from the addresses in the list. Write the addresses of your load balancers. See the HAProxy documentation.

    proxy-protocol-patch.yaml
    apiVersion: v1
    kind: ConfigMap
    metadata:
    name: haproxy-ingress # dual: haproxy-ingress-internal and haproxy-ingress-external
    namespace: ingress-haproxy
    data:
    proxy-protocol: "10.0.0.10, 10.0.0.11" # the addresses of your load balancers
  3. Add the patch files to the customPatches section of your furyctl.yaml:

    furyctl.yaml
    spec:
    distribution:
    customPatches:
    patchesStrategicMerge:
    - ./proxy-protocol-patch.yaml
  4. Apply the configuration:

    furyctl apply

The ingress controller now accepts the PROXY protocol from the load balancer, and gets the address of each client.