Skip to content

Conversation

@QiWang19
Copy link
Member

@QiWang19 QiWang19 commented Oct 13, 2025

Propose a new CRIOCredentialProviderConfig CRD that enables use namespace-scoped secrets for mirror registry authentication.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 13, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 13, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@QiWang19 QiWang19 changed the title ImageCredentialProviderConfig API for Namespace-Scoped Mirror Authent… ImageCredentialProviderConfig for Namespace-Scoped Mirror Authentication Oct 13, 2025
@QiWang19
Copy link
Member Author

/test all

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great write-up, it nicely summarizes the whole effort!

@QiWang19 QiWang19 force-pushed the crio-credential-config branch from 060f30d to 7d1b2f9 Compare October 14, 2025 23:04
@QiWang19 QiWang19 marked this pull request as ready for review October 14, 2025 23:12
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 14, 2025
@QiWang19
Copy link
Member Author

@saschagrunert PTAL

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM 👍

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 15, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: saschagrunert
Once this PR has been reviewed and has the lgtm label, please assign dhellmann for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@saschagrunert
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 15, 2025
@QiWang19 QiWang19 changed the title ImageCredentialProviderConfig for Namespace-Scoped Mirror Authentication CRIOCredentialProviderConfig for Namespace-Scoped Mirror Authentication Oct 15, 2025
@QiWang19 QiWang19 force-pushed the crio-credential-config branch from 7d1b2f9 to 14465a6 Compare October 15, 2025 19:02
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Oct 15, 2025
@QiWang19 QiWang19 changed the title CRIOCredentialProviderConfig for Namespace-Scoped Mirror Authentication OCPNODE-3753: CRIOCredentialProviderConfig for Namespace-Scoped Mirror Authentication Oct 15, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 15, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 15, 2025

@QiWang19: This pull request references OCPNODE-3753 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set.

In response to this:

Propose a new CRIOCredentialProviderConfig CRD that enables use namespace-scoped secrets for mirror registry authentication.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 15, 2025

@QiWang19: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@saschagrunert
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2025
name: system:serviceaccount:app-team-alpha:app-service-account
```

3. Cluster Admin configures cluster-wide `CRIOCredentialProviderConfig` object specifying source registries that should trigger `crio-credential-provider`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Cluster Admin configures cluster-wide `CRIOCredentialProviderConfig` object specifying source registries that should trigger `crio-credential-provider`
4. Cluster Admin configures cluster-wide `CRIOCredentialProviderConfig` object specifying source registries that should trigger `crio-credential-provider`


2. Machine Config Operator container runtime config controller

- Extend the container runtime config controller to manage the `CRIOCredentialProviderConfig` objects

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Extend the container runtime config controller to manage the `CRIOCredentialProviderConfig` objects
- Extends the container runtime config controller to manage the `CRIOCredentialProviderConfig` objects


- resolves mirrors from `/etc/containers/registries.conf` for source image repository(docker.io/nginx)

- Finds mirror pull secrets in Pod namespace (team-alpha-mirror-secret) by using the service account token from the request

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Finds mirror pull secrets in Pod namespace (team-alpha-mirror-secret) by using the service account token from the request
- Finds mirror pull secrets in Pod namespace (app-team-alpha-mirror-secret) by using the service account token from the request


4. CRI-O image pull:

- Detects the file `/etc/crio/auth/<NAMESPACE>-<IMAGE_NAME_SHA256>.json` exists, uses the auth file for image pull authentication

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In previous 'Component Changes & Interactions' part, it describes:
If the auth file generated by crio-credential-provider exists, moves the auth file from /etc/crio/auth/<NAMESPACE>-<IMAGE_NAME_SHA256>.json to a unique temporary location (/etc/crio/auth/in-use/<NAMESPACE>-<IMAGE_NAME_SHA256>-<UUID>.json) for each image pull

So it's better to add the part of moving auth file to a unique temporary directory

apiVersion: credentialprovider.kubelet.k8s.io/v1
```

##### Step 2: Application Deployment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this enhancement have strict formatting requirements. It seems the font and color of titles at each level are not consistent. It's better to standardize.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's just a problem of github, not the content.


- Generates a short-lived authentication file for each image pull at `/etc/crio/auth/<NAMESPACE>-<IMAGE_NAME_SHA256>.json`, which includes mirror credentials, source registry credentials, and any global pull secrets.

- Returns empty `CredentialProviderResponse` to kubelet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the reason why we return empty credential instead of returning the token in the response?

I think we discussed it somewhere, but I forgot where it was.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The kubelet will ignore the credentials within the response if it does not match the original image (without tag or digest). Means the we cannot pass the credentials there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants