Getting the "real IP" from a request inside of a k3d cluster #869
Unanswered
dreimsbach
asked this question in
Q&A
Replies: 1 comment
-
Hi @dreimsbach , thanks for starting this discussion! First off: What's the bug you faced when using hostnetwork? From the command you pasted there, I assume that the problem is with the loadbalancer, which shouldn't be there (and doesn't make sense) in the hostnetwork setup. There seems to be an open issue on this for ages (also applies for Docker on Linux) which is also still open on the roadmap. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I run a k3d cluster of one node on a Debian 11 server. I've disabled Traefik and use nginx as Ingress controller.
I have several different applications running in the cluster that are accessible via subdomains of my main domain eg. app1.my-domain.com, app2.my-domain.com, ...
Originally I wasn't able to get the original IP from requests on those apps. X-Forwarded-For was always the IP of the docker bridge. I really searched a lot for solutions. Only thin that helped was using the host network. Then it was fine and I am getting those real IPs.
With updating to K3d 5.03, there is a bug preventing the use of host networks. Anyway, it's a workaround and I like to get rid of it as I really want to have more nodes in the cluster.
That's why I finally ask here for help. Thats my cluster creation with k3d 4.4.8 (when host network was working properly).
My nginx ingress looks like this
With that configuration I get the real IP because I use the "host" network. When I remove that arg from creating the cluster, the IPs I get are the one from the docker bridge.
What do I wrong here?
Beta Was this translation helpful? Give feedback.
All reactions