Replies: 6 comments 2 replies
-
Just wanted to ask that I looked at the e2e examples and I am even more confused because they seem to show that you need both the plugin and the container which begs the question: what is the point of the plugin if you're using the container as well? Also, |
Beta Was this translation helpful? Give feedback.
-
Hello @tam481 ! So basically, Sablier is an API first. You can read a few things about it here: https://github.com/acouvreur/sablier#api But this will not be the common use case for everybody. More than that, I think few people would like to manually hit the API to start a container. So in order to automatically start containers by name, reverse proxies integrations are being built. These middleware do the API calls to Sablier instead of you. So you'd need the container Sablier, you can use the version you want, I'd recommand you to use the latest stable version, which at this point is 1.2.0. So use acouvreur/sablier:1.2.0. And then to load your middleware with the same version to your Traefik instance.
I'm not sure if it's on Sablier middleware ends for this issue, I look it up more closely later. Is this more clear to you? |
Beta Was this translation helpful? Give feedback.
-
Thank you so much @acouvreur for making the time to explain how this works. That makes things a lot clearer now. In essence the Sablier container does the work of starting and stopping containers. The plugin intercepts requests to the shutdown container via Traefik, for example, and sends the relevant API calls to the Sablier container to start the container the user is trying to access. This is why you need both. One to do the actual work and the other to effectively send the commands that tell Sablier which container to start. In terms of configuration, I've set up a sablier.yaml file as follows:
I have more questions, if I may:
Thank you for looking into the config error in my original post. |
Beta Was this translation helpful? Give feedback.
-
I've just tried using labels attached to the Sablier container and I can now see two middlewares in Traefik (dynamic@docker and blocking@docker) However, a few minutes later the Sablier container exited and shutdown. I checked the docker logs for the Sablier container and found: The Middlewares in Traefik disappeared and the container is showing an error which is understandable as the Middleware it is supposed to use is no longer available. Is this some sort of bug or am I missing something? I suspect I messed up somewhere as I don't know how the Traefik Plugin is being used as it looks like I'm using the Sablier container directly. |
Beta Was this translation helpful? Give feedback.
-
I see what I did. I did specify "sablier" in the docker-compose labels section for Sablier. I assumed that was the name of the Sablier container. traefik.http.middlewares.dynamic.plugin.sablier.names=sablier There seems to be inconsistencies though, looking at the example you kindly referenced, it looks like Sablier will only use the strategy and theme settings if specified in the docker-compose label and not in the config yaml file but will happily use the port from the config file. Also, if I don't use docker labels and instead rely on the config yaml file and the Traefik dynamic configs, the Middleware does not work at all. I get the "plugin: invalid configuration: no configuration or too many plugin definition" error. I'm slowly getting there and I don't know if the above observations are valid or just my lack of understanding but I'm really grateful for your help. |
Beta Was this translation helpful? Give feedback.
-
I ran into this too, this seems to have stemmed from a mistake in the example config, where the plugin name,
|
Beta Was this translation helpful? Give feedback.
-
Hi
I love the idea of Sablier.
I need help with getting it to work with Traefik
The main question I have is about the plugin for Traefik: do you use the plugin in place of the Sablier container or alongside it?
Here is my Traefik static config:
This is the dynamic config file:
ytapp-svc is the name of the service for the container I want to shutdown when not in use. This is the config part in the dynamic configuration file for Traefik:
Traefik shows "sablier@file" under HTTP Middlewares with its status as "Success"
Assuming you only need the plugin, I set up the above and added sablier@file as the middleware for the http router for ytapp but when I start it both the Middleware and the app show "plugin: invalid configuration: no configuration or too many plugin definition"
Please help.
Beta Was this translation helpful? Give feedback.
All reactions