Skip to content
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

Logging Driver: Allow driver to use docker DNS by joining docker network #2537

Closed
hamiltont opened this issue Aug 21, 2020 · 14 comments
Closed

Comments

@hamiltont
Copy link

hamiltont commented Aug 21, 2020

Is your feature request related to a problem? Please describe.

We run a docker swarm and are looking into the Loki driver. One snag - all examples I can find for loki-url use either a static domain (e.g. loki.foo.com) or they use the docker host IP address (host.docker.internal).

Neither of these work well a swarm with multiple nodes that is running a loki instance inside the swarm. The docker host address will not work at all on nodes other than the one node running loki

Describe the solution you'd like

Ideally, we could specify which network to attach the loki driver to (currently it runs with the host's network). That would allow the common docker pattern of using a docker-provided DNS name that round-robins to the matching containers. This would also work well in swarm mode using an overlay network. For example:

loki-url: http://loki:3100/loki/api/v1/push
loki-network: loki

Describe alternatives you've considered

We considered HTTP redirect sidecars to make the host.docker.internal approach work on all nodes, even those not running loki. Problem is you need to run the sidecar on all nodes except the node running loki, so you now have to label your nodes specifically to work around this issue.

We also considering using a static name (e.g. loki.foo.com) and only making it available from inside the swarm. While this would work for our production stack, anyone trying to do local development would have a problem (we often spin up a vagrant-powered swarm cluster locally) and have to reconfigure their local machine to affix a permanent IP address to the loki container, which can change location. In short, they would have exactly the type of issue the docker dns system addresses ;-)

@hamiltont hamiltont changed the title Logging Driver: Allow using container identifier instead of loki-url Logging Driver: Allow driver to use docker DNS by joining docker network Aug 22, 2020
@stale
Copy link

stale bot commented Sep 21, 2020

This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale A stale issue or PR that will automatically be closed. label Sep 21, 2020
@hamiltont
Copy link
Author

hamiltont commented Sep 21, 2020 via email

@stale stale bot removed the stale A stale issue or PR that will automatically be closed. label Sep 21, 2020
@stale
Copy link

stale bot commented Oct 22, 2020

This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale A stale issue or PR that will automatically be closed. label Oct 22, 2020
@hamiltont
Copy link
Author

hamiltont commented Oct 22, 2020 via email

@stale stale bot removed the stale A stale issue or PR that will automatically be closed. label Oct 22, 2020
@caleb-adams
Copy link

This is highly desirable for my team.

@rosconap
Copy link

Would like some more info on this as well.

@stale
Copy link

stale bot commented Dec 17, 2020

This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale A stale issue or PR that will automatically be closed. label Dec 17, 2020
@batazor
Copy link
Contributor

batazor commented Dec 18, 2020

up

@stale stale bot removed the stale A stale issue or PR that will automatically be closed. label Dec 18, 2020
@stale
Copy link

stale bot commented Jan 17, 2021

This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale A stale issue or PR that will automatically be closed. label Jan 17, 2021
@hamiltont
Copy link
Author

🔼

@stale stale bot removed the stale A stale issue or PR that will automatically be closed. label Jan 18, 2021
@stale
Copy link

stale bot commented Feb 21, 2021

This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale A stale issue or PR that will automatically be closed. label Feb 21, 2021
@batazor
Copy link
Contributor

batazor commented Feb 21, 2021

🆙

@stale stale bot removed the stale A stale issue or PR that will automatically be closed. label Feb 21, 2021
@cyriltovena
Copy link
Contributor

cyriltovena commented Feb 22, 2021

There's nothing we can do, by default the plugin runs on the host network.

see #1368 (which has workaround and a lot of explanation) and #1962

cyriltovena pushed a commit to cyriltovena/loki that referenced this issue Jun 11, 2021
* handling of empty directories in filesystem object client

Signed-off-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>

* calling os.Remove instead of os.RemoveAll while removing empty directory

Signed-off-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>

* some minor improvement

Signed-off-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>

* negative test for isNotEmptyErr

Signed-off-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>

* some changes suggested from PR review

Signed-off-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>

* fixed comment

Signed-off-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>

* changes suggested from PR review

Signed-off-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>
@KES777
Copy link

KES777 commented Oct 31, 2022

@cyriltovena How to run plugin on different network?

My service is ran on its own network:

networks:
  mynet:

It would be nice that logging driver loki will attach to service's network. And this issue should be mentioned on documentation page: https://grafana.com/docs/loki/latest/clients/docker-driver/

I dig whole the day, to understand what is happening... =(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants