caddyserver / ingress

WIP Caddy 2 ingress controller for Kubernetes
Apache License 2.0
637 stars 70 forks source link

How to get Client IP? #176

Closed gnasnik closed 9 months ago

gnasnik commented 10 months ago

First of all, thank you for such a great project. I replaced ngnix-ingress with caddy-ingress in order to be able to automatically register the certificate. This is all great, but my usage scenario requires obtaining the ClientIP, but I did not find the relevant documentation. Did I miss something?

mavimo commented 9 months ago

@gnasnik if you enable the proxy pass in the load balancer (depending from the cloud provider this can be done via annotation or ..) you will get the Client IP properly

clems71 commented 9 months ago

I had the same problem, and if your cloud provider does not support PROXY protocol, you can use what I introduced recently: https://github.com/caddyserver/ingress/pull/168 (works fine with Azure AKS)

mavimo commented 9 months ago

@clems71 NB: your PR is merged but we still need to release the last version of the chart, will be available soon ;)

mavimo commented 9 months ago

Helm chart is released (and also include the new version of the Caddy Ingress controller), now both PROXY PASS and ClientIP are available 😄