-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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-3619: Fine-grained SupplementalGroups control #117842
KEP-3619: Fine-grained SupplementalGroups control #117842
Conversation
Skipping CI for Draft Pull Request. |
04cc30c
to
8d38468
Compare
74b822e
to
3052133
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.
Addressed comments for no need featuregate checks in validation logics. And rebased to the latest master.
/approve for API Needs sig-node review, please |
I will review for sig-node. |
"$ref": "#/components/schemas/io.k8s.api.core.v1.ContainerUser" | ||
} | ||
], | ||
"description": "User represents user identitiy information of the first process in the container" |
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: identity
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.
addressed in 5f0d761
pkg/apis/core/types.go
Outdated
@@ -2741,6 +2741,31 @@ type ContainerStatus struct { | |||
// +optional | |||
// +featureGate=RecursiveReadOnlyMounts | |||
VolumeMounts []VolumeMountStatus | |||
// User represents user identitiy information of the first process in the container |
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: identity
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.
addressed in 5f0d761
The node bits look fine. Only other nit I have is making the commits additive vs. fixing up earlier commits. |
Thanks🙌👍! And, my typo was fixed.
I think squashing my commits into one would be nice. Are we ready to squash now??
For container runtimes supporting this feature, we need to merge this PR first as defined in CRI API | Feature development. Thus, e2es will be added in another PR after containerd released the newer version which supports this. Am I right? |
This comment was marked as off-topic.
This comment was marked as off-topic.
Yes, that's right.
The PR looks ready to me. |
/label tide/merge-method-squash |
Thanks! /lgtm |
LGTM label has been added. Git tree hash: c42214bbbcc0a9c46c00a8fc6bed4b676bd28450
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: everpeace, thockin 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 |
No, thank you for your patience and perseverance!
Message ID: ***@***.***>
… |
* Add `Linux{Sandbox,Container}SecurityContext.SupplementalGroupsPolicy` and `ContainerStatus.user` in cri-api * Add `PodSecurityContext.SupplementalGroupsPolicy`, `ContainerStatus.User` and its featuregate * Implement DropDisabledPodFields for PodSecurityContext.SupplementalGroupsPolicy and ContainerStatus.User fields * Implement kubelet so to wire between SecurityContext.SupplementalGroupsPolicy/ContainerStatus.User and cri-api in kubelet * Clarify `SupplementalGroupsPolicy` is an OS depdendent field. * Make `ContainerStatus.User` is initially attached user identity to the first process in the ContainerStatus It is because, the process identity can be dynamic if the initially attached identity has enough privilege calling setuid/setgid/setgroups syscalls in Linux. * Rewording suggestion applied * Add TODO comment for updating SupplementalGroupsPolicy default value in v1.34 * Added validations for SupplementalGroupsPolicy and ContainerUser * No need featuregate check in validation when adding new field with no default value * fix typo: identitiy -> identity
* Add `Linux{Sandbox,Container}SecurityContext.SupplementalGroupsPolicy` and `ContainerStatus.user` in cri-api * Add `PodSecurityContext.SupplementalGroupsPolicy`, `ContainerStatus.User` and its featuregate * Implement DropDisabledPodFields for PodSecurityContext.SupplementalGroupsPolicy and ContainerStatus.User fields * Implement kubelet so to wire between SecurityContext.SupplementalGroupsPolicy/ContainerStatus.User and cri-api in kubelet * Clarify `SupplementalGroupsPolicy` is an OS depdendent field. * Make `ContainerStatus.User` is initially attached user identity to the first process in the ContainerStatus It is because, the process identity can be dynamic if the initially attached identity has enough privilege calling setuid/setgid/setgroups syscalls in Linux. * Rewording suggestion applied * Add TODO comment for updating SupplementalGroupsPolicy default value in v1.34 * Added validations for SupplementalGroupsPolicy and ContainerUser * No need featuregate check in validation when adding new field with no default value * fix typo: identitiy -> identity
What type of PR is this?
/kind feature
What this PR does / why we need it:
Implements kubernetes/enhancements#3619
Special notes for your reviewer:
The actual policy enforcement will be implemented by container runtimes (cri-api implementations). Because most container runtimes (e.g. containerd) depend on https://github.com/kubernetes/cri-api, this PR should be merged before container runtimes implement actual policy enforcement. Please also see CRI API | Feature development.
My PR in containerd is already opened and in review: containerd/containerd#9737. It already got LGTM (containerd/containerd#9737 (review)) except for cri-api dependency, which will be updated once this PR gets merged and v1.31 alpha or beta version is released.
If you wanted to try running this feature, you can try it with kind easily: https://gist.github.com/everpeace/2ae0233cc91644ac8797cf192e40ba39
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: