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

Feature request: Filter and ignore Containers. #210

Open
DamionWaltermeyer opened this issue Sep 7, 2016 · 3 comments
Open

Feature request: Filter and ignore Containers. #210

DamionWaltermeyer opened this issue Sep 7, 2016 · 3 comments

Comments

@DamionWaltermeyer
Copy link

Please make my boss happy. ^_^

[1:27 PM]
Boss: I’m looking harder at docker-gen as the cause of many of our woes
think it’d be an easy fix if true, but would probably require changes to the source

[1:27 PM]
dwaltermeyer What do you think the issue is?

[1:27 PM]
Boss: it gets notified about everything that happens
so, on a busy server like sp5(hundreds of "tiny containers"), that’s a lot of events.

Even stopping "Our container than governs multiple tiny containers", docker-gen is still dealing with a backlog of events three or four minutes later.

It only regenerates and pokes nginx when a container with a VIRTUAL_HOST env param comes or goes but I think when a new "tiny-container" comes along, it inspects every container to build its map of what’s out there bottom line is I want it to be able to filter out and ignore containers that start with "tiny-container-name" and I want it to only receive container events not network events, volume events, and everything else that its getting bombarded with and has to throw away

docker-gen is the heart of nginx-proxy-helper
so it gets a ton of events for containers that come and go that don’t touch the nginx config

Thanks in advance to anyone capable and willing to tackle this.

@jwilder
Copy link
Collaborator

jwilder commented Sep 7, 2016

That looks feasible. The Docker events API has some filters that can be specified to reduce events. It looks like a lot more events are sent now than when docker-gen was first written so that is likely why it's getting so many and getting backlogged. docker-gen really only looks at container events for start, die, etc.. but, it looks like that could be done from the API directly via filters={"event"="<string>"}

@DamionWaltermeyer
Copy link
Author

Thanks for the reply. We'd like to do the opposite of docker api filtering. If I'm understanding it, docker api filters display only that event(inclusive), but I'd like to do something exclusionary for docker-gen's intake so it won't get bogged down. In our use case, we have hundreds of containers per host with the majority of them being containers with the same prefix that we don't need and a wide variety of remaining containers we'd like to include.
Thanks again.

@JanMalte
Copy link

This is actually an issue with running gitlab-runner on the same host as the docker-gen container.

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

3 participants