registrator
registrator copied to clipboard
add option to ignore silent services
There are cases where you'd want only specific containers to be registered, and avoid accidental name collisions. The -ignore-silent option makes registrator ignore containers that do not explicitly expose any SERVICE_ variables.
Can you define "silent?" Wouldn't SERVICE_IGNORE help with this issue?
May be not the best terminology, but by "silent" I meant containers that do not have any SERVICE_ env vars set. Imagine a general docker server where you only want one or two containers to be "registered". The others will just clutter up the registry. Running this all other containers with SERVICE_IGNORE would be bothersome (especially in a multi-user environment).
Okay that's fair. I'm going to leave this open because we'll probably want to implement it differently with recent changes but it'll be good to have this as reference.
Thanks!
+1 for this ... We recently started investigating using registrator in our environment and we really need the option to only register containers that are explicitly tagged for it to be feasible.
+1
+1
Any progress on this topic? It's been over 4 years already with no discernable progress on what is obviously a desired feature with minimal intrusion on the codebase. What else is there left to "investigate"? If there is a better / more idiomatic way to address this problem, a note should be added here and the issue closed, as this is still the first result that comes up when someone is searching for this topic.
In my case, I have some services that register with Consul directly, and others that do not, but which still must be generally discoverable. I could, of course, wrap each of the stock container images with registration glue, but this seems to be the very thing that registrator is supposed to make unnecessary.
If there's no appetite for this change upstream, I'm more inclined to create a registrator image that includes the change, as this will be far less hassle than providing a per-container workaround.
To reply to myself - and as a note for anyone else in a simular situation - as per https://gliderlabs.com/registrator/latest/user/services/ it seems SERVICE_IGNORE will help with the issue of determining which containers to exclude explicitly, while the proposed change in this PR looks to invert the logic to skip any unlabelled containers, which would clean up some of the tagging and noise in e.g. more elaborate compose files. For the time being, I will tag my already-registering containers with SERVICE_IGNORE, and should this PR be merged at some point in the future, adapt my compose file accordingly.