-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
KEP-4412: Projected Service Account Tokens for Kubelet Image Credential Providers #4846
KEP-4412: Projected Service Account Tokens for Kubelet Image Credential Providers #4846
Conversation
aramase
commented
Sep 12, 2024
- One-line PR description: Add Projected Service Account Tokens for Kubelet Image Credential Providers alpha KEP
- Issue link: Projected service account tokens for Kubelet image credential providers #4412
335b23c
to
65a5019
Compare
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
581f7e2
to
049905b
Compare
/cc @enj |
cc @mikebrow @SergeyKanzhelev @ndixita @ruiwen-zhao @harche @haircommander as per #4412 (comment). PTAL! |
049905b
to
fd08023
Compare
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Show resolved
Hide resolved
19842b8
to
2c0f66f
Compare
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
2c0f66f
to
1eb7a85
Compare
/assign @deads2k /assign enj liggitt haircommander |
1eb7a85
to
c44af73
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.
First pass.
...g-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/kep.yaml
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
72d5fe0
to
49094d3
Compare
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Show resolved
Hide resolved
We will expand the on-disk kubelet credential provider configuration to allow an | ||
optional `tokenAttribute` field to be configured. When this field is not set, no KSA | ||
token will be sent to the plugin. When it is set, the Kubelet will provision | ||
a token with the given audience bound to the current pod and its service |
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.
will the token be time-bound? If so - how long?
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.
will it work nicely with things like stargz snapshotter where secret can be stored for a long time like: https://github.com/containerd/stargz-snapshotter/blob/main/docs/overview.md#cri-based-authentication?
cc: @samuelkarp
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.
will the token be time-bound? If so - how long?
Yes, the token will be time-bound. The duration will be fixed at 1h (?). If the cloud provider associates this token duration to the credential lifetime, we don't want it to be too short-lived. 1h seems reasonable to cover those scenarios to prevent frequent calls to cloud provider for token exchange.
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.
will it work nicely with things like stargz snapshotter where secret can be stored for a long time like: https://github.com/containerd/stargz-snapshotter/blob/main/docs/overview.md#cri-based-authentication?
IIUC, the stargz snapshotter in CRI-based authentication
gets the same registry credentials as the CRI from kubelet, so that wouldn't change here? The credentials could now be short-lived if the lifetime is tied to the KSA token lifetime but otherwise should work the same way. Please correct me if I'm wrong.
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.
stargz is not downloading the whole image in one go. So it may keep streaming pieces after 1h
. So it will end up with the stale credentials
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.
stargz is not downloading the whole image in one go. So it may keep streaming pieces after 1h. So it will end up with the stale credentials
The credential provider plugin gets the PSAT and exchanges that for a registry credential. The registry credential is the one that stargz
uses and it's not the PSAT right?
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.
correct. I think this can be compared to current behavior without specific PSAT: if a node wide credential expires while the image is being pulled with stargz, what does the runtime do? I'd expect the same here.
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.
oh, ok. So we are not giving time limited token to runtime. If this is the case, it will work
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 wonder if there is any test we can write that will validate that and ensure we are not breaking this scenario?
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.
The tests in kubelet credential provider wouldn't validate this because it fetches the registry credentials and passes it to CRI (no change in behavior).
Tests in stargz would be good to confirm it works as expected when the registry credentials expire/it updates its cache when the credentials for the image change.
@SergeyKanzhelev do you know who can confirm if there are tests for this in stargz
?
49094d3
to
9a88044
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.
some updates for beta criteria and PRR please.
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
6416856
to
b124de2
Compare
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
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.
Looks inverted?
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
15baea4
to
9b15829
Compare
9c027e3
to
6a0f049
Compare
PRR lgtm. KEP also lgtm, but I'll leave lgtm to @enj and whoever is looking from node. /approve |
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.
typo
...-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md
Outdated
Show resolved
Hide resolved
…ential Providers Signed-off-by: Anish Ramasekar <[email protected]>
6a0f049
to
57865a0
Compare
SIG node LGTM: #4846 (comment) /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aramase, deads2k, enj 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 |