Add support to pull data from multiple docker endpoints (e.g. swarm)#548
Add support to pull data from multiple docker endpoints (e.g. swarm)#548tarasov65536 wants to merge 3 commits intonginx-proxy:mainfrom
Conversation
fix getContainers
# Conflicts: # internal/generator/generator.go
|
Hi @buchdag, I’d love to help move this PR forward if there’s interest (like here nginx-proxy/nginx-proxy#97) in adding support for pulling container data from multiple Docker endpoints — especially for Swarm setups. I understand the code might be outdated and possibly conflicts with the current main branch. If that’s the case, I’m happy to resolve any conflicts and submit a clean, updated version of the PR. Just for context: I’ve been running this implementation successfully in a Docker Swarm environment for the past couple of years. It’s been working reliably in production and enables tools like nginx-proxy to have visibility into containers across all Swarm nodes, which was the main motivation for this contribution. Please let me know what would be the best way to proceed. Would it make sense to create a new PR based on the current main branch, or is there a particular direction you’d prefer? Thanks in advance! |
|
There is definitely still interest in this and I would happily review a new PR 👍 One thing I did not get from this PR is how |
… into multiple-enpoints # Conflicts: # README.md # cmd/docker-gen/main.go # internal/generator/generator.go
|
Hi @buchdag , Thanks for your reply! I’ve just merged the latest Regarding your question: the core idea of Swarm support in this PR is that we can define multiple So, even in Swarm mode:
This matches the typical use case I have in production: This setup works very reliably for me, and I’m hoping that this PR can help push that logic further into the |
This PR adds support to request container data from multiple docker endpoints. For example in swarm you now can get containers information from all nodes at once.
Main idea is that
endpointparameter refers to local docker node for which docker-gen generates configs. And theswarm-nodeparameters define additional docker nodes from which docker-gen pulls containers information.Back compatability preserved. If no
swarm-nodestated then docker-gen collects information only from local docker endpoint defined byendpointparameter.In case when stated at least one
swarm-nodeparameter docker-gen will collect containers information from swarm-node list. And useendpointonly for "controlling" purpose (e.g. to notify containers).Root use-case for this PR is to make possible for projects like nginx-proxy to have full information across all swarm cluster.