ofelia icon indicating copy to clipboard operation
ofelia copied to clipboard

Live jobs discovery from docker labels

Open mathroc opened this issue 7 years ago • 5 comments

It would be nice to discover jobs looking at container and services tags (à la traefik)

eg, in a docker-compose file :

labels:
  - ofelia.schedule: "@hourly"
  - ofelia.command: "touch /tmp/example"

it could support job-exec and job-service-run (once #49 is merged) or maybe a job-service-exec style

this would make it much easier to work with as you wouldn't have to give access to the container running ofelia or its configuration to the user running app containers or stacks

the idea come from traefik and https://github.com/vfarcic/docker-flow-cron but this project is not ready nor very active

mathroc avatar Oct 23 '18 09:10 mathroc

Awesome feature! I'm just thinking of this when I had to change my config file because my container changes it's name...

With label, it will be easily flexible and reusable! Totally need this feature :heart:

Nightbr avatar Dec 07 '18 07:12 Nightbr

This feature would be awesome. Trane9991's fork ( mentioned in https://github.com/mcuadros/ofelia/issues/66#issuecomment-475956283 ) has this implemented.

klingac avatar May 29 '19 10:05 klingac

This is indeed a great feature, and it works wonderfully with Traefik. The one thing I'm noticing that's different is that it's looking at container labels, instead of service labels, and when a service updates itself, Ofelia isn't picking up the new containers that come from that, so you'd need to restart it every time you update a service.

Is it possible for Ofelia to periodically poll Docker for labels, instead of just doing it once at startup?

G-regL avatar Nov 07 '19 20:11 G-regL

Manual restart ofelia every time after changing containers labels is a big sadness.

4n70w4 avatar Apr 17 '20 15:04 4n70w4

Very related to #137

bertbesser avatar Feb 13 '21 08:02 bertbesser