-
Couldn't load subscription status.
- Fork 5.3k
add proposal about container-level serviceaccount #2497
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,6 +80,9 @@ type ServiceAccountTokenProjection struct { | |
| ExpirationSeconds int64 | ||
| // Path is the relative path of the file to project the token into. | ||
| Path string | ||
| // If true, the token this volume contains would include informations about | ||
| // which container the token will mount on. | ||
| IsContainerLevel bool | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this would mean the kubelet would have to fan out and maintain N tokens for a pod with N containers... is that what we want? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @liggitt For most use cases who don't need container-level serviceaccount feature, they just launch a token projection volume with IsContainerLevel being false. In this case, all the containers could share single serviceaccount token. |
||
| } | ||
| ``` | ||
|
|
||
|
|
@@ -88,7 +91,8 @@ sourced from the TokenRequest API into volumes created from | |
| ProjectedVolumeSources. As the token approaches expiration, the kubelet volume | ||
| plugin will proactively rotate the service account token. The kubelet will start | ||
| trying to rotate the token if the token is older than 80 percent of its time to | ||
| live or if the token is older than 24 hours. | ||
| live or if the token is older than 24 hours. If IsContainerLevel is true, the | ||
| volume should be used by single container exclusively. | ||
|
|
||
| To replace the current service account token secrets, we also need to inject the | ||
| clusters CA certificate bundle. Initially we will deploy to data in a configmap | ||
|
|
||
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.
without a consistent enforcement mechanism to guarantee these tokens are only used in requests from that container, I don't think we can make that claim
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.
kubernetes/kubernetes#61858 insert pod information into user.Info.Extra() , and we could not make sure the tokens are only used in requests from that pod neither. So what's the difference between the container information and pod information. I am a little confused about this.
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.
those assert what pod the token was created for, they do not assert that is where the request is coming from