-
Notifications
You must be signed in to change notification settings - Fork 94
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
CAA: add support to look up imagePullSecrets for pods #2232
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx, looks good! the override semantics are interesting here, I'd intuitively expect that a cluster-wide auth.json is overridden by a pod-specific auth.json, but we're doing the opposite here. some questions:
does it make sense to retire the existing caa-wide "auth.json" mechanism in favor of passing this from kubernetes? the caa-wide param is roughly comparable to a node-wide auth.json in the kubelet config, which is discouraged (and which we don't consider it here, either).
I would suggest to at least deprecate the parameter and mark it for later removal.
If we don't want to remove the caa-wide auth.json, would we be able to "merge" both sources?
if we don't want to remove the caa-wide auth.json, would it make sense for pod-specific auth.json to take precedence?
What are the implications for auth.json that come from KBS?
@@ -259,6 +259,17 @@ func (s *cloudService) CreateVM(ctx context.Context, req *pb.CreateVMRequest) (r | |||
_, err = os.Stat(SrcAuthfilePath) | |||
if err != nil { | |||
logger.Printf("credential file %s is not present, skipping image auth config", SrcAuthfilePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the log message needs to be adjusted, to indicate that we fall back on image-pull-secrets from the pod
@bpradipt @snir911 - I think you added the CAA wide auth.json, so wanted to check if you had any concerned with this. I'm inclined to agree with Magnus, that it would be good to replace the CAA-wide approach with a pod specific one, but am unsure if this would cause challenges with the pause image pull on OpenShift? |
Afaicr, the pause image is embedded now. |
I left the cluster wide auth.json overwriting the pod specific secrets because this way current code that uses cluster wide auth.json would not be broken. I think merging the secrets would also be ok as long as the pod secrets do not conflict with the cluster wide secret. Let me know which approach to take and I will adjust the changes. |
I would opt for removing the option to have a cluster-wide auth.json in this case. If I understood it correctly there is no use case for that anymore. Propagating it from the cluster is the right call, IMO. since the manifest will still be pulled on the node different maintaining different sets of registry credentials in k8s and caa config can be pretty confusing. |
42e1cf8
to
3630bc7
Compare
I like the idea, from the pause image pulling POV i don't think it would be an issue in Openshift.. |
f3a0d8b
to
c9c2e02
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Thanks @squarti
@squarti - are you able to rebase this please to pick up the latest changes. Also I'd like to understand where we ended up with on the user experience here: I think the consensus was having support for node wide secret that is overridden with a deployment specific imagePullSecret? |
This PR initializes auth.json with the imagePullSecrets listed on the pod and service account. Fixes: confidential-containers#2231 Signed-off-by: Silenio Quarti <[email protected]>
I think the consensus was to remove the option to have a cluster-wide auth.json. |
Ok, that's not what was discussed on the community call, which I appreciate you weren't present at. From a quick scan above I think it looks like mostly @mkulke was for removing the cluster-wide option, but was supporting it on the call? I don't really mind either way, but I'd like some community agreement here, |
Fwiw, I'm ok to remove the cluster-wide auth option since imagepullSecret can be provided via the SA. Also with this change it decouples the pod image pull secret from node specific secret. |
afair, in the discussion the rationale for the keeping a cluster-wide option was: we currently don't know how to propagate credentials that are specified "out-of-band" on the node to the podvm, e.g. as a kubelet option or via other container runtime means. an alternative that I can imagine would be to provide a simple docs explaining how an "auth.json" can be embedded in in the image. I think in both cases we need logic to merge auth.json and a specified behaviour for overlaps / preference. maybe we can leverage existing libraries. |
This PR initializes auth.json with the imagePullSecrets listed on the pod and service account.
Fixes: #2231