function61 / promswarmconnect

Bridges Docker Swarm services to Prometheus without any changes to Prometheus
https://function61.com/
Apache License 2.0
24 stars 6 forks source link

Connect to docker daemon with mapped docker.sock and dont use ssl certificates and docker proxy #3

Closed man4j closed 5 years ago

man4j commented 5 years ago

If map docker.sock inside container and use Docker client for GO you can simplify deployment of this solution. What are the disadvantages of the proposed option? Thanks.

joonas-fi commented 5 years ago

Good question!

Then you have to strictly run this on the Swarm manager node, because the manager node's Docker socket is the only place where you get info for the whole cluster's tasks. And if the manager node changes, this container also has to relocate to the new node. This can be accomplished with a placement constraint of node.role == manager (see example in dockersockproxy).

Initially I thought that it's better for promswarmconnect to not have this constraint, and have dockersockproxy handle this awkwardness, since I have to have the dockersockproxy anyway because I'm using Portainer at my home which also needs remote and secure access to the Docker socket.

But you're totally right, this TLS + client cert authentication makes this more complicated for all other people than myself, so that'd be selfish for me not to include the simpler option. I'll make this change immediately!

joonas-fi commented 5 years ago

Docker socket option is now implemented, and the README now contains much better usage documentation.

Thanks for pushing me to do better!