Digital Ocean just announced Proxy Protocol support for kubernetes load balancers.
https://blog.digitalocean.com/load-balancers-now-support-proxy-protocol/
How can we modify Nginx Ingress to work with the proxy protocol to get source ip of visitors?
Perhaps annotations?
I hope Digital Ocean engineers have tested proxy protocol with Nginx Ingress controllers
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
I got it working!!! The answer is to create a config map with use-proxy-protocol: “true” as follows:
Step 1. Follow instructions from the tutorial
Step 2. Create the following configmap.yaml that includes use-proxy-protocol:
Step 3. Apply configmap.yaml
Step 4. Create your ingress resource:
Step 5. Apply your ingress resource:
Step 6. Wait for the External IP of your load balancer
Step 7. Enable Proxy Protocol on your load balancer
Step 8. Update your DNS A records with your External IP
Best of luck …
BTW … there’s an issue with proxy protocol and the jet stack cert-manager.
See https://github.com/jetstack/cert-manager/issues/466
My only workaround is to temporarily disable proxy protocol on the load balancer (and nginx ingress config map) allowing the certificate to be issued.
For anyone using Helm, you can replace steps 1, 2 and 3 (above) with the following …