-
Notifications
You must be signed in to change notification settings - Fork 40.5k
e2e_node: add a test to verify kubelet fails to create pod if userns isn't supported #127484
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
Conversation
/hold requires kubernetes/test-infra#33511 to actually run |
0b0b4cd
to
259f70a
Compare
259f70a
to
bbcea1c
Compare
/test pull-kubernetes-node-crio-cgrpv2-userns-e2e-serial |
/triage accepted |
/hold Let's confirm that the test you added works before merge. |
/hold cancel new test passed https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/127484/pull-kubernetes-node-crio-cgrpv2-userns-e2e-serial/1836871735580823552 some other test that's now in this suite failed, but that shouldn't block IMO |
admissionapi "k8s.io/pod-security-admission/api" | ||
) | ||
|
||
var _ = SIGDescribe("UserNamespaces", "[LinuxOnly]", nodefeature.UserNamespacesSupport, framework.WithSerial(), func() { |
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.
is this test really serial?
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.
Yes, when ever a feature gate is toggled for kubelet, the test has to be serial. Changing kubelet configs triggers a restart of kubelet.
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.
Til, thanks, this explains why some test here are tagged as serial when they are not ..., authors may forget to remove the serial decorator when it is ga .... @pohly does it make sense to automate this behavior for the e2e_node so authors don't need to worry about this behavior?
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 don't see how. nodefeature.UserNamespacesSupport
just says "this test depends on this feature", it doesn't say "this test needs to toogle that feature", so nodefeature.UserNamespacesSupport
should not implicitly add the serial tag.
authors may forget to remove the serial decorator when it is ga
Doesn't it say below that the entire test needs to be removed once the feature is GA?
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.
yeah this test is only serial because it changes the kubelet's feature gates, not specifically toggles user namespaces. Once user namespaces are GA'd (and specifically when the feature gate is dropped), we have to remove this test because we can't test with user namespaces disabled anymore
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.
Once user namespaces are GA'd (and specifically when the feature gate is dropped), we have to remove this test because we can't test with user namespaces disabled anymore
Do we need to capture this in userns GA plan not to forget ?
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.
Actually with apiserver emulated versions we'll keep feature gates around after GA, so it will only be removed when it's been GA everywhere for a while. I think this test could also be updated in the future to handle when the node doesn't support userns
|
||
// Pod should stay in pending | ||
// Events would be a better way to tell this, as we could actually read the event, | ||
// but history proves events aren't reliable enough to base a test on. |
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.
v1.Events? those must no be used on tests, are best effort , there is no guarantee there are going to be delivered
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.
exactly
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.
A bit confused, how to interpret lines 75 - 76, do you mean events are not a better way ( so we could just delete the two comment lines ) or you mean we should improve reliability of events ?
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 mean they'd be a more accurate way if they could be relied on, but since they can't be relied on we can't use them, even though it'd give us the exact reason the pod is still in pending
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.
Thanks for clarifying
/lgtm |
/hold @aojea , @pohly , @bart0sh and @SergeyKanzhelev please review / approve and decide if it is ok to cancel hold, thanks |
Looks good to me. I think the pending discussions have been resolved. This is a SIG Node test. It should be approved by someone from SIG Node, not me as SIG Testing TL. |
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haircommander, SergeyKanzhelev 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 |
/hold cancel |
/lgtm cancel @haircommander this PR cannot be merged because of [KEP-3041] - remove nodefeatures from k/k repo /cc @kannon92 |
…isn't supported and the pod requests a user namespace Signed-off-by: Peter Hunt <[email protected]>
bbcea1c
to
8b4aab5
Compare
oops good point! fixed |
/retest |
/lgtm |
LGTM label has been added. Git tree hash: c9efe769ec6e02c1b0c200a6ebab5e1b5b507470
|
Phew, I had a huge ???? moment when this PR showed up in the merge queue and the title elided this part 😂 I feel like maybe the super long title would be worth it this time 🙃 🚲 🏠 🎨 🖌️ |
We have to urge users to switch to userns pods somehow 😈 |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
... and the pod requests a user namespace
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: