rancher: Can't bind on 127.0.0.1
Using managed network, trying to create port mapping like 127.0.0.1:24004:24004 opens port on 0.0.0.0
Using host network - port fails to open on both 127.0.0.1 and any other ip.
Use case: I want to create a proxy for logs from docker containers. But because log driver from docker runs on daemon it knows nothing about managed network. I want to create a proxy, running on localhost, that other containers can write to. This proxy will aggregate logs and ship them to other facilities accessible via internal network/internal dns/etc.
Useful | Info |
---|---|
Versions | Rancher v1.2.2 Cattle: v0.174.13 UI: v1.2.40 |
Access | localauth admin |
Orchestration | Cattle |
Route | stack.index |
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 4
- Comments: 18 (2 by maintainers)
@zot24 I found a workaround to that by adding in the edit page of the host the ip: 127.0.0.1. I really don’t know if this is the expected behavior but it works for me now.
Any updates guys? Binding on localhost (127.0.0.1) should be a simple feature since 0.0.0.0 is working by default. There are a lot of reasons here (security for example) and maybe the feature can be extended to binding on a specific IP on a host with multiple LANs to cover all of the use cases. Cheers!
So i found a workaround for Rancher 1.6.15 you can expose ports to 127.0.0.1 when you set a specific host under the scheduling tab. So i guess this will be useless for multihost setups.
Tried your compose file on 1.6.13 with a different port because 80 is already bound in my host
Unfortunately the result is this:
i.e. service cannot be started with these logs
Maybe I’m doing something wrong
Any updates on this? Issue seems to be still existing on 1.16.10. We are running a service that needs to proxied on the host but this exposes the service to the internet.
I’m experiencing a similar issue where I got the following configuration (that was working on Rancher 1.2.2)
But with Rancher Server 1.6.7 I just get the following error