Skip to content

Conversation

@mikebrow
Copy link
Member

@mikebrow mikebrow commented Mar 10, 2020

As discussed over a somewhat recent SIG-NODE meeting

We desire to add support for ensuring images pulled with pod imagePullSecrets are
always authenticated even if cached. With this feature always pull would not be required to ensure authentication for images pulled with secrets based auth. Instead kublet will check if the image was pulled with an image pull secret and if so would force a pull of the image to ensure the image pulled with the secret is not used by another pod unless that pod also has the proper auth.

Addresses kubernetes/kubernetes#18787

Signed-off-by: Mike Brown [email protected]

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 10, 2020
@k8s-ci-robot k8s-ci-robot added kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/node Categorizes an issue or PR as relevant to SIG Node. labels Mar 10, 2020
@mikebrow mikebrow force-pushed the ensure-secret-pulled-image branch 5 times, most recently from 2c0a91e to 0625f87 Compare March 10, 2020 15:21
Copy link
Contributor

@mattjmcnaughton mattjmcnaughton left a comment

Choose a reason for hiding this comment

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

@mikebrow thanks for your KEP!

I jotted down some quick questions that I'm hopeful will help drive some more discussion. Thanks :)

@Random-Liu
Copy link
Member

Random-Liu commented Mar 24, 2020

I had an offline discussion with @mikebrow. This is a bit different from what he discussed a while back (something similar to #1608 (comment)). However, after he explained the ideas to me, I think it makes even more sense now!

When the kubelet flag ensureSecretPulledImages turns on, the default behavior of kubelet will be changed to always reauth/repull if a pod tries to use an image-secret pair that hasn't been authenticated recently, regardless of what the ImagePullPolicy is.

This seems to be a good first step, and even be a good default behavior in the future (no need to change the pod spec). Based on my understanding, usually people use cached images with PullNever or PullIfNotPresent for 2 reasons:

  1. To avoid re-pulling the image as a performance optimization.
  2. To use preloaded images because the node doesn't have internet access or the image is not pushed to any registry.

The "new default behavior" seems safe and won't break the 2 cases above.
For case 1), in the worst case, we'll only do an extra re-auth, so it shouldn't affect performance much. And if users use the image with the previously authenticated secrets, they can even avoid the re-auth.
For case 2), you usually don't need secrets to access those preloaded image anyway.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 22, 2020
@mikebrow
Copy link
Member Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 23, 2020
@mikebrow mikebrow force-pushed the ensure-secret-pulled-image branch from 0625f87 to cfd0f8f Compare August 25, 2020 20:43
@k8s-ci-robot k8s-ci-robot added the sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. label Aug 25, 2020
@mikebrow
Copy link
Member Author

Ready to go forward with this on a 1.20 schedule now that the 1.19 log jamb is behind us :-)

@mikebrow
Copy link
Member Author

Updated to address comments and reflect detail around the current implementation kubernetes/kubernetes#94899

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 20, 2020
@mikebrow
Copy link
Member Author

mikebrow commented Jan 9, 2021

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 9, 2021
@mikebrow mikebrow force-pushed the ensure-secret-pulled-image branch from 96ea11a to a66c822 Compare September 8, 2021 00:09
@mikebrow
Copy link
Member Author

mikebrow commented Sep 8, 2021

updated for 1.23 and added test plan detail..

@mikebrow mikebrow force-pushed the ensure-secret-pulled-image branch 4 times, most recently from fa8e449 to 53ddcab Compare September 8, 2021 14:49
@johnbelamaric
Copy link
Member

PRR is OK, but needs SIG approval

@ehashman
Copy link
Member

ehashman commented Sep 8, 2021

/approve

for PRR

Copy link
Member

@derekwaynecarr derekwaynecarr left a comment

Choose a reason for hiding this comment

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

can you update the kep to reflect agreement that the feature should maintain security across kubelet restart and node reboot events?

the alpha could be restricted to an in-memory map, but the beta criteria should meet the above goals?

thanks!

@mikebrow mikebrow force-pushed the ensure-secret-pulled-image branch from 53ddcab to 64a17e7 Compare September 8, 2021 22:26
Copy link
Member

@derekwaynecarr derekwaynecarr left a comment

Choose a reason for hiding this comment

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

thanks for the prompt updates.

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 9, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: derekwaynecarr, ehashman, mikebrow

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 9, 2021
@salaxander salaxander removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 10, 2021
@k8s-ci-robot k8s-ci-robot merged commit 459359d into kubernetes:master Sep 10, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Sep 10, 2021
RomanBednar pushed a commit to RomanBednar/enhancements that referenced this pull request Jul 30, 2024
…tions

add link to doc about declaring a feature Accessible-by-default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/node Categorizes an issue or PR as relevant to SIG Node. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.