You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LoadBalancer Services cannot discover the true ClientIP #74
ProxyProtocol support is coming soon to Linode NodeBalancers, which will allow all of these use cases either directly at the TCP level or beyond the Ingress controller. 🚀
Hi @mortenbirkelund! Proxy Protocol support was very recently added to NodeBalancers, so the next step is to add a Service annotation to this codebase that will allow enabling it. We don't have a specific timeline for this implementation at the moment. I will update this issue as soon as there is a PR or other progress on that.
Is there anything else that we need to do to benefit from this other than thechangelog/changelog.com@a29bee7 & then just waiting for this to be rolled out across Node Balancers?
@carminalazu In the manifest that you linked, you're placing the annotation on an Ingress resource. However, this annotation is used by Service resources. In your case, it would be the Service that sits in front of ingress-nginx.
The nginx-ingress docs explain that the Proxy protocol is a different approach:
Another option is to enable proxy protocol using use-proxy-protocol: "true".
In this mode NGINX does not use the content of the header to get the source IP address of the connection.
This is the ingress-nginx config update that we should end up with:
This feature adds an annotation for LoadBalancer Services which enables Proxy Protocol on the associated NodeBalancers. This means that an Ingress controller that supports Proxy Protocol, like nginx-ingress, can then provide X-Forwarded-For headers to its backends.
Yes, you would need to modify that Service resource to add the annotation service.beta.kubernetes.io/linode-loadbalancer-proxy-protocol: "v2" Also, your diff looks correct, which disables header forwarding and enables Proxy Protocol.
To answer your last question. I'm happy to report that as of October 2nd all Linode NodeBalancers and LKE clusters support these features!
@asauber After enabling proxy, I am having some problems. I have a registy hosted on the same kubernetes cluster, and after enabling proxy protocol, it is no longer possible to pull images from the registry.
When looking into the Ingress-controller pod I see the following errors when trying to pull an image.
@mortenbirkelund Hi there! Once the the PR is merged and a new CCM release is made with those changes, an LKE update will follow that will include an update to the CCM to the latest released version. We will ensure that when the update is available, the LKE changelog will reflect the CCM version being used. Thanks!
Tried to use the newly added annotation service.beta.kubernetes.io/linode-loadbalancer-hostname-only-ingress: "true" but it doesnt seem to work. cert-manager is still failing because of self-check not going through.
I'm still very confused. Is this truly fixed?
Is there some documentation for the correct encantations to get X-Forwarded-For to send the client IP when using helm to install the nginx ingress controller?
Installing the helm chart below automatically creates the node balancer but doesn't setup the proxy protocol as above (for me at least).
The following configuration for the helm chart worked for me: helm upgrade --install ingress-nginx -f helm/inginx-ingress/customvalues.yaml ingress-nginx/ingress-nginx
Activity
asauber commentedon Jul 27, 2020
Yes, thank you for your comment. 😄
ProxyProtocol support is coming soon to Linode NodeBalancers, which will allow all of these use cases either directly at the TCP level or beyond the Ingress controller. 🚀
Use X-Forwarded-For in ingress-nginx logs
mortenbirkelund commentedon Aug 25, 2020
@asauber any news or time-line for when this will be supported? Thanks
asauber commentedon Aug 27, 2020
Hi @mortenbirkelund! Proxy Protocol support was very recently added to NodeBalancers, so the next step is to add a Service annotation to this codebase that will allow enabling it. We don't have a specific timeline for this implementation at the moment. I will update this issue as soon as there is a PR or other progress on that.
laszlocph commentedon Sep 24, 2020
🎉
asauber commentedon Sep 25, 2020
All LKE clusters will be upgraded to use this version of the CCM within the next two weeks.
mortenbirkelund commentedon Sep 27, 2020
@asauber great news. Thanks for the update
Use ProxyProtocol as soon as it becomes available
carminalazu commentedon Oct 5, 2020
Is there anything else that we need to do to benefit from this other than thechangelog/changelog.com@a29bee7 & then just waiting for this to be rolled out across Node Balancers?
asauber commentedon Oct 5, 2020
@carminalazu In the manifest that you linked, you're placing the annotation on an Ingress resource. However, this annotation is used by Service resources. In your case, it would be the Service that sits in front of
ingress-nginx.Once you've enabled Proxy Protocol for ingress-nginx, it looks like you would also need to set this setting in the ingress-nginx ConfigMap https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#use-proxy-protocol
carminalazu commentedon Oct 6, 2020
I was assuming that this feature will make the
X-Forwarded-For,X-Real-IPheaders work as expected, which is what this captured:https://github.com/thechangelog/changelog.com/blob/0e4e5831f494129d0697e34a54a5673e58c4491d/k8s/ingress-nginx/configmap.yml#L8-L12
The nginx-ingress docs explain that the Proxy protocol is a different approach:
This is the ingress-nginx config update that we should end up with:
If I understand you correctly, the annotation needs to be put on this service. Is that right?
https://github.com/kubernetes/ingress-nginx/blob/274d09447e4735815846985c3133bbdc3f00a942/deploy/static/provider/cloud/deploy.yaml#L273-L301
One last question: what happens if the PROXY protocol is enabled on the nginx ingress, but the node balancers don't have this capability rolled out?
asauber commentedon Oct 8, 2020
This feature adds an annotation for LoadBalancer Services which enables Proxy Protocol on the associated NodeBalancers. This means that an Ingress controller that supports Proxy Protocol, like nginx-ingress, can then provide X-Forwarded-For headers to its backends.
Yes, you would need to modify that Service resource to add the annotation
service.beta.kubernetes.io/linode-loadbalancer-proxy-protocol: "v2"Also, your diff looks correct, which disables header forwarding and enables Proxy Protocol.To answer your last question. I'm happy to report that as of October 2nd all Linode NodeBalancers and LKE clusters support these features!
asauber commentedon Oct 8, 2020
A description for this Proxy Protocol annotation can be found in the top level Readme https://github.com/linode/linode-cloud-controller-manager#annotations
mortenbirkelund commentedon Oct 14, 2020
@asauber After enabling proxy, I am having some problems. I have a registy hosted on the same kubernetes cluster, and after enabling proxy protocol, it is no longer possible to pull images from the registry.
When looking into the Ingress-controller pod I see the following errors when trying to pull an image.
I have anonymized the domain and the ip
As soon as I disable proxy protocol in the ingress controller, everything works fine.
9 remaining items
mortenbirkelund commentedon Oct 25, 2020
@asauber thanks for the good explanation
It seems like my docker registry doesn't allow setting multiple hostname (I am using harbor) goharbor/harbor#8243
So I guess I will either have to move my registry to a separate cluster or hope that you will implement a fix as suggested by @laszlocph
jittuu commentedon Oct 29, 2020
I am now facing the cert-manager issue. The challenge is failed if Proxy Protocol is enabled.
I guess I have to wait for a while to use proxy protocol.
asauber commentedon Nov 3, 2020
Hi. A quick update for this issue. We have decided to implement the hostname-based fix for this within the coming weeks.
In the mean time, users have reported success using this controller-based solution https://github.com/compumike/hairpin-proxy
allow inter-service communication from within cluster via external LB
mortenbirkelund commentedon Dec 30, 2020
@asauber any idea when this will be implemented. I see there is an open pull request for it.
sibucan commentedon Dec 30, 2020
@mortenbirkelund Hi there! Once the the PR is merged and a new CCM release is made with those changes, an LKE update will follow that will include an update to the CCM to the latest released version. We will ensure that when the update is available, the LKE changelog will reflect the CCM version being used. Thanks!
allow inter-service communication from within cluster via external LB
allow inter-service communication from within cluster via external LB
mortenbirkelund commentedon Jun 28, 2021
Tried to use the newly added annotation
service.beta.kubernetes.io/linode-loadbalancer-hostname-only-ingress: "true"but it doesnt seem to work. cert-manager is still failing because of self-check not going through.https://github.com/compumike/hairpin-proxy however did solve the problem.
calbot commentedon Dec 30, 2021
I'm still very confused. Is this truly fixed?
Is there some documentation for the correct encantations to get X-Forwarded-For to send the client IP when using helm to install the nginx ingress controller?
helm upgrade --install ingress-nginx -f helm/inginx-ingress/customvalues.yaml ingress-nginx/ingress-nginxmy customvalues.yaml file:
Can the documentation here https://www.linode.com/docs/guides/how-to-deploy-nginx-ingress-on-linode-kubernetes-engine/
be updated so that X-Forwarded-For is properly set?
I see this page https://www.linode.com/docs/guides/nodebalancer-reference-guide/ says
nginx should have the following settings
Mine also has
real_ip_recursive on;coming from the helm template. Would that be the source of the problem?calbot commentedon Dec 30, 2021
I was able to figure it out. If anyone else is using the helm chart instructions (from https://www.linode.com/docs/guides/how-to-deploy-nginx-ingress-on-linode-kubernetes-engine/) you can do the following...
Log into the linode console > Nodebalancers > instanceID > configuration > 443/80 > Port Configuration > Proxy Protocol. I selected v2
Installing the helm chart below automatically creates the node balancer but doesn't setup the proxy protocol as above (for me at least).
The following configuration for the helm chart worked for me:
helm upgrade --install ingress-nginx -f helm/inginx-ingress/customvalues.yaml ingress-nginx/ingress-nginxcustomvalues.yaml
After that the
X-Forwarded-Forwas sent to my appbadrdouah commentedon Nov 27, 2022
i think you mean
"do" stands for digital ocean, this line in not nessecary, the second one will do the job i guess
LukasBlu1 commentedon May 2, 2023
Hi all! Is this also working with nodejs, in case yes, is there someone who has a tutorial for this? Thanks in advance :)
Kliprmimo commentedon Nov 12, 2025
Hey, i tried running cert manager ith this settings in ingress nginx:
I run into the issue discussed earlier:
broken header: "GET /.well-known/acme-challenge/xxx HTTP/1.1" while reading PROXY protocolIs there a known "non-hacky" or recommended way to properly handle the PROXY protocol for HTTP-01 ACME challenges with cert-manager and ingress nginx?