-
Notifications
You must be signed in to change notification settings - Fork 284
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
Add support for Docker credential helpers #789
base: master
Are you sure you want to change the base?
Conversation
@david-garcia-garcia not sure if you're the right person, but it looks like you've been active on this repo. Any chance you can look at this PR or point me to the right person? |
@ldx I took a look at the implementation. Hope you can help with some questions. [1] How are you supposed to get the credential helper binaries into the keel image? [2] The helper you are sharing (https://github.com/chrismellard/docker-credential-acr-env) seems to be using the identity from within the container itself. I guess to make the wiring work in Azure you'll need to setup workload identity on the keel pod which is not currently supported in the Helm chart. I am mainly using Azure and was trying to figure out the actual setup details needed to use this to have keel authorize private registries without having to explicitly add ACR credentials to all containers (which I've been doing so that keel can see private registries when polling). |
There are a couple of ways. What I did is to build my own image, installing the credential helper. If one wants to use the official keel image, an initcontainer with the helper, sharing the helper binary with the main container via an
Yes, that is correct, but an MSI should also work (i.e. one can use the kubelet identity in AKS as well). But a pod workload identity is the best option IMO.
Exactly, I did not want to deal with ACR credentials. Adding an ACR-specific token auth flow like it is implemented for AWS and GCR felt like reinventing the wheel, given that this is exactly the goal of Docker credential helpers. But I understand it's a tradeoff between managing an external dependency vs maintaining code for each managed registry, thus some people might prefer a self-container ACR extension in Keel. Personally I'm in favor of reusing existing Docker credential helpers. |
With all that feedback this is what comes to my mind:
|
This sounds good to me. Anything you wanted to include or change in this PR? |
This PR adds the ability to use existing Docker credential helpers (like
docker-credential-ecr-login
,docker-credential-gcr
, etc.) for registry authentication. This enables Keel to leverage the same credential management tools that users already have configured in their Docker environments, instead of re-implementing registry credential helpers in Keel itself.I used the same helper registration method as in the aws and gcr helpers. The only input the new helper needs is the name of an executable that implements the Docker credential protocol (registry name is supplied via stdin, and a command line argument
get
is added when executing the program). The executable name is passed in via theDOCKER_CREDENTIALS_HELPER
environment variable (and can be just the name of the executable without the full path).The main use case for me was adding Azure ACR support without hacks or implementing an ACR-specific extension, and leveraging
https://github.com/chrismellard/docker-credential-acr-env
instead, together with Keel polling the registry.