New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix traefik behavior when network_mode is host #5698
Conversation
Anything I can do to speed the merging of this one? |
@ldez the underlying PR (moby/moby#40007) just got merged. Any idea when this one will get reviewed? |
@FuNK3Y WDYT about my reword on the documentation? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. You might keep the docker desktop part ouf of it; in my initial PR I mentioned it, but it turns out that host mode is not supported:
The host networking driver only works on Linux hosts, and is not supported on Docker Desktop for Mac, Docker Desktop for Windows, or Docker EE for Windows Server.
(https://docs.docker.com/network/host/)
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
Fix FMT?
Added a few info about host networking
Remove new line
Replaced token by default IP address, as the feature is not yet released
Remove reference to docker desktop
It's worth noting that this broke a unit test which is still broken on master, but possibly only on hosts with
|
What does this PR do?
When traefik cannot identify the ip address of the container, it returns 127.0.0.1 no matter what. This behavior is not desirable in many situations (i.e. exposed container running in network_mode = host while traefik doesn't, docker desktop, ...)
Motivation
It solves #5559 and #5535 and maybe a few other I didn't catch
Additional Notes
For this to work in linux, moby/moby#40007 needs to be merged. In the meantime you need to define "host.docker.internal" using extra_hosts if you want to take advantage of it.
In any case, this won't alter the current behavior. If you are running traefik in network_mode host or on a platform/version that does not provide the dns record its behavior won't change.