acouvreur / sablier

Start your containers on demand, shut them down automatically when there's no activity. Docker, Docker Swarm Mode and Kubernetes compatible.
https://acouvreur.github.io/sablier/
GNU Affero General Public License v3.0
1.16k stars 43 forks source link

Suggestion: Traefik dynamic configuration provider #288

Open thielj opened 2 months ago

thielj commented 2 months ago

Right now, enabling services for use with sablier requires managing configuration in various locations as Traefik discards dynamic configuration obtained from docker when a container is stopped.

An alternative would be for sablier to provide this information. I don't know if it's possible through the plugin, but providing an HTTP end point scraped by Traefik every few seconds would work.

acouvreur commented 2 months ago

It's an interesting solution indeed. Thanks for proposing that.

However, this behavior is really for a specific usage of traefik.

Note that in future releases of traefik, you should be able to use Sablier labels just like traefik labels to register the plugin configuration.

And as you mentioned, currently stopped containers will be discarded from the pool so you have to configure this in files and it may not be practical for you.


Now, this behavior has been identified as a bug in traefik: see https://github.com/traefik/traefik/issues/9907#issue-1725043940

If I have time, I will fix the issue on the Traefik repository.

So instead of developing a scraper, I'd recommend you to wait for the option to be available for Traefik.

Does that make sense ?

aless3 commented 2 weeks ago

traefik maintainers have questions on changing allowEmptyServices, what do you think?

btw this is not to pressure you, but maybe their reply slipped your mind in a busy period or the like, it happens all the time to me

acouvreur commented 2 weeks ago

Hello @aless3, thanks for your interest in the project :)

I'm currently busy on a lot of other things in my life, I'll be able to work on the project soon enough.

I'm also using traefik and docker and I'm looking forward to be able to use sablier on my own services :D

aless3 commented 1 week ago

ah yes, life comes first obviously, good luck with that!