-
Notifications
You must be signed in to change notification settings - Fork 418
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
Allow for conflicting namespaces: introducing backend prefixes #278
Comments
Let me try to rephrase to see if I understand correctly: Adding a prefix notion in the top level config can be tricky when one day there is a need to, instead of trimming prefix, adding a prefix for backends. To me, it sounds like the responsibility of the backend itself to decide how to interpret the namespace, and it is probably also much more flexible to do this outside of kraken. I wonder if a proxy would solve your problem. i.e. kraken will treat the proxy as backend and pull from it. The proxy redirects requests based on path. |
@evelynl94 : thanks for your reply! :)
Couldn't have said it better :)
I'm not sure I understand what you mean here, could you please elaborate?
A proxy can indeed do the job, but that adds another moving piece, and another critical service to keep up at all times. Having several backends, with no obvious way to separate them into regex-based namespaces, seemed to me to be a generic enough problem, that enough teams are likely to encounter, that it would make sense to support this scenario in Kraken itself; especially considering that it adds little complexity to it. |
My 2c -- probably the easiest way to do this is by implementing a backend.Client (to be used by build-index to fetch tags) which strips the namespace prefix from the tag name and then calls into a real backend. Something like:
I'm hesitant to commit this upstream, since it's clearly targeting a very specific use-case. Given that backends are pluggable, this should be fairly easy to support in your own private repo (we do this for numerous internal backends at Uber). |
Having prefix in the top level config is probably not ideal because we would be enforcing all backends to interpret prefix the same way (i.e the prefix will be trimmed). I agree with Cody that this sounds more specific to a custom backend (it could also serve as your proxy layer). |
Thanks @codygibb and @evelynl94 |
Mainly to allow writing "wrapper" custom backends, see eg uber#278 (comment)
Mainly to allow writing "wrapper" custom backends, see eg uber#278 (comment)
Mainly to allow writing "wrapper" custom backends, see eg uber#278 (comment) Signed-off-by: Jean Rouge <rougej+github@gmail.com>
Is your feature request related to a problem? Please describe.
I have 3 different backends,
a
,b
andc
. I'd like Kraken to provide a single registry for all three.As I understand it, Kraken currently allows to do that as long as the image names (repos and tags) in all three backends obey to some pattern that allows them to be neatly divided into Kraken namespaces. However, for reasons outside of my control, that's not the case for me: any image name can be found in any backend.
I'd still like to be able to configure Kraken to be able to do
docker pull localhost:8081/a/my/image:1.0
(assuming the Kraken agent is listening on port 8081), and have Kraken understand that I want to pullmy/image:1.0
from backenda
; anddocker pull localhost:8081/b/my/image:1.0
would pullmy/image:1.0
from backendb
.Describe the solution you'd like
A way to achieve that could be to add a new, optional
prefix
field in backend definitions, that Kraken would understand to be the artificial prefix that it needs to remove when talking to the underlying backend.The example from the previous section could then be configured as:
That change would enable that new use-case while being completely seamless for existing deployments/configurations.
I would be happy to submit a PR for this as long as maintainers pre-approve the idea.
Thanks.
The text was updated successfully, but these errors were encountered: