-
Notifications
You must be signed in to change notification settings - Fork 159
Support private images by leveraging pull secrets #27
Comments
There's a security consideration here in that all users with Consider the following scenario:
|
AFAIU, the flaw is not with this PR, but with the very notion of Kubernetes Pull Secrets, and the fact that there is no standard way for the Docker CLI to generate a long-standing pull-token for a specific repo (that can be revoked by the owning user), and so Pull Secrets contain credentials with much more access rights than necessary. Within the set of constraints we have:
|
@alexmavr @justincormack do you think of potential alternatives ? I am a bit short on ideas. |
I think there is no issue on the API Server / Controller side, it is more a User Experience problem |
I don't think that this workflow should use the user's credentials. I know that is how the pull secrets docs suggest you use it, but as Alex points out this secret then belongs to the service account, so it should be a service account registry account (ie read only access, not attached to a specific user, scoped for the repos that this service account needs) that is used. For dev use it is kind of ok to use your own creds, but this is never the right thing in production. The ideal workflow for EE would probably have UCP set up DTR service accounts that could be populated easily as read only accounts for the team that is using that service account. That would be out of band from the compose controller though. For desktop a simpler scheme that just uses your creds would be ok (until we get better read only token support). |
Hmm IIRC, swarm's implementation of
2b. add a In any case, I think that on the compose-on-kubernetes side, these different approaches have no impact. WDYT? |
I definitely don't think we should do 1. or 3., and would generally be in favour of removing that from Swarm, ideally to match Kub behaviour once we have a usable path there. 2 probably with something like 2b sounds good to me. |
Reopening for tracking CLI side |
CLI side is merged, but we also want to have private image support trough using a Service Account already associated with pull secrets. (keeping it open then) |
Any docs for how to use this? |
Hello @cjancsar there are no documentations right now, as these features are still experimental.
|
I've adding
It definitely exists, I can Alternatively, are there any workarounds that one can do right now to get their private images into a k8s cluster using a compose file? |
I have specified version: '3.7'
services:
myservice:
x-pull-secret: mysecret
[...]
secrets:
mysecret:
external: true and checked client and server versions: $ docker version
Client: Docker Engine - Community
Version: 19.03.8
API version: 1.40
[...]
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 19.03.8
API version: 1.40 (minimum version 1.12)
[...]
Experimental: true
Kubernetes:
Version: v1.15.10
StackAPI: v1alpha3 yet, when running |
Depends on #26.
We need to add a field on ServiceConfig for referencing a PullSecret, and convert it on reconciliation.
The flow would be:
$ docker stack deploy --with-registry-auth
docker cli
get the registry auth info and populate a k8s secret named<service>.pull-secret
docker cli
populate the PullSecret field in the service config with the secret namedocker cli
post the stackcompose controller
converts service configPullSecret
field into the PullSecret field of a ContainerSpeckubernetes
is capable of using the pull secret to make kubelet pull the imageThe text was updated successfully, but these errors were encountered: