-
Notifications
You must be signed in to change notification settings - Fork 174
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
Can I use the network name instead of IP range to define controller network? #286
Comments
CADDY_CONTROLLER_NETWORK only needs to be defined when executing separate "controller" and "server". The "controller" part connects to docker API and it could use it to find the network IP ranges for a specific docker network name. We could create a CADDY_CONTROLLER_NETWORK_NAME that works on the controller side. But the "server" part is meant to not depend on docker API, therefore docker network name is not very useful here. It needs the IP ranges in order to allow traffic only from that range. We can't use CADDY_CONTROLLER_NETWORK_NAME here, but we could allow traffic from any IP range if that doesn't concern you. |
Hi, Thanks for getting back to me - this is for a stack with a separate controller and 3 servers. The controller is only connected to the The servers are connected to the ingress network and the We have an overall /17 network which is assigned to docker, so all connections would be from that range, but when I use that on the servers like this:
...I get Does the CIDR range in the |
It doesn't need to be exactly the same. caddy-docker-proxy/plugin/cmd.go Line 112 in 4893c4d
You need to make sure you use a CIDR that covers caddy-controller network, but doesn't cover ingress. Otherwise, it might mistakenly end up binding configs to ingress network. |
I will try later to set it to "tcp/0.0.0.0:2019" |
Thanks for looking into this - as the ingress is also in the overall /17 we've decided to keep specifying the /24 range for now to keep configuration access locked down. |
hmmm. I have several swarms that I deploy stacks to, with different overlay address pools. Its not clear that --caddy-controller-network can be omitted, and I don't like declaring overlay networks with explicit cidrs as libnetowrk is stupid and will allocate an overlapping network if it ever gets to that range. If not a network name, what about a DNSRR name. e.g. Assuming that the servers are simply binding to the provided address, I can see that this won't work, but... |
@chrisbecke DNS might work, but we would need to test if the controller DNS name is reachable from each network interface to determine which one is the right one. I'm considering making controller networks optional at #428 |
Rather than reserve a specific network range i think it would be much more straightforward to be able to configure the caddy controller something like this:
Is this possible? It should then be able to figure out the range automatically.
The text was updated successfully, but these errors were encountered: