Skip to content
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

cri: pass pull image credentials to snapshotter #6336

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bergwolf
Copy link
Contributor

@bergwolf bergwolf commented Dec 6, 2021

Pass them via annotations so that a snapshotter can fetch image contents
with proper credentials. It is needed for remote snapshotters like
estargz and nydus. While it is possible for the snapshotters to parse
credentials on their own, but it several drawbacks:

  1. snapshotter needs to access containerd config file
  2. snapshotter needs to handle different credential sources that are
    already handled by kubelet/containerd
  3. snapshotter needs additional kubernetes privileges to access
    kubernetes secrets APIs

By passing image pulling credentials to snapshotters, we can avoid the
above drawbacks. The behavior is still toggled by the current
disable_snapshot_annotations option and is disabled by default.

Fixes: #5105

/cc @ktock @ruiwen-zhao @alakesh

Pass them via annotations so that a snapshotter can fetch image contents
with proper credentials. It is needed for remote snapshotters like
estargz and nydus. While it is possible for the snapshotters to parse
credentials on their own, but it several drawbacks:
1. snapshotter needs to access containerd config file
2. snapshotter needs to handle different credential sources that are
   already handled by kubelet/containerd
3. snapshotter needs additional kubernetes privileges to access
   kubernetes secrets APIs

By passing image pulling credentials to snapshotters, we can avoid the
above drawbacks. The behavior is still toggled by the current
`disable_snapshot_annotations` option and is disabled by default.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
@k8s-ci-robot
Copy link

@bergwolf: GitHub didn't allow me to request PR reviews from the following users: ruiwen-zhao, alakesh.

Note that only containerd members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

Pass them via annotations so that a snapshotter can fetch image contents
with proper credentials. It is needed for remote snapshotters like
estargz and nydus. While it is possible for the snapshotters to parse
credentials on their own, but it several drawbacks:

  1. snapshotter needs to access containerd config file
  2. snapshotter needs to handle different credential sources that are
    already handled by kubelet/containerd
  3. snapshotter needs additional kubernetes privileges to access
    kubernetes secrets APIs

By passing image pulling credentials to snapshotters, we can avoid the
above drawbacks. The behavior is still toggled by the current
disable_snapshot_annotations option and is disabled by default.

Fixes: #5105

/cc @ktock @ruiwen-zhao @alakesh

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/test-infra repository.

@k8s-ci-robot
Copy link

Hi @bergwolf. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Dec 6, 2021

Build succeeded.

@dmcgowan dmcgowan added this to New in Code Review via automation Dec 6, 2021
@dmcgowan dmcgowan moved this from New to Needs Discussion in Code Review Dec 6, 2021
@kzys
Copy link
Member

kzys commented Dec 6, 2021

It is a scary path to take to be honest. Have we put credentials in labels before? Wouldn't it leak credentials to logs?

@bergwolf
Copy link
Contributor Author

bergwolf commented Dec 7, 2021

@kzys I don't think we've done it before. You are right that we need to audit the code to make sure we never print snapshot annotations in any logs.

@cpuguy83
Copy link
Member

cpuguy83 commented Dec 8, 2021

We would be storing creds in plaint text on disk, I think?
I don't like this solution.

@ruiwen-zhao
Copy link
Member

I guess my major concerns are

  1. By adding the cred to labels, which are stored in bolt db, we are essentially storing the creds on disk.
  2. People might not be aware that the labels contain sensitive info and might be logging or mishandling them (we might be doing it today I am not sure)

I guess a more preferred way is what is proposed here: #5105

@mxpv mxpv added the status/needs-update Awaiting contributor update label Sep 17, 2023
@k8s-ci-robot
Copy link

PR needs rebase.

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/test-infra repository.

@dims dims added the area/cri Container Runtime Interface (CRI) label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cri Container Runtime Interface (CRI) needs-ok-to-test needs-rebase status/needs-update Awaiting contributor update
Projects
Code Review
Needs Discussion
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

Enable remote snapshotter to receive creds from containerd CRI plugin
7 participants