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
e2e node pod overhead #88558
e2e node pod overhead #88558
Conversation
bd3be7d
to
1bf9651
Compare
1bf9651
to
012c060
Compare
012c060
to
867e44d
Compare
5c6206d
to
b7b9a13
Compare
/test pull-kubernetes-e2e-kind-ipv6 |
I have a bit less context on what a node_e2e test should ideally look like, I would like sig node to review this |
b7b9a13
to
afe5c71
Compare
afe5c71
to
8526c1b
Compare
test/e2e_node/runtimeclass_test.go
Outdated
Containers: []v1.Container{ | ||
{ | ||
Image: busyboxImage, | ||
Name: "container" + string(uuid.NewUUID()), |
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.
why randomize the container name?
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.
Do e2e_node run in parallel? I suppose since it isn't a "real" cluster we shouldn't expect there could be a pod running already with this name?
I saw this was best practice in the scheduler e2e tests.
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 container name doesn't need to be unique, just the pod name.
8526c1b
to
1b72565
Compare
Updated, PTAL @tallclair |
@derekwaynecarr ptal |
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.
Just a few nits
test/e2e_node/runtimeclass_test.go
Outdated
Containers: []v1.Container{ | ||
{ | ||
Image: busyboxImage, | ||
Name: "container" + string(uuid.NewUUID()), |
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 container name doesn't need to be unique, just the pod name.
1b72565
to
fc77f75
Compare
This test will verify that the Pod cgroup created takes Overhead into account. Signed-off-by: Eric Ernst <eric@amperecomputing.com>
fc77f75
to
aa12e1f
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.
/lgtm
/approve
Thanks!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: egernst, tallclair 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 |
@egernst: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/test pull-kubernetes-e2e-kind-ipv6 |
/milestone v1.18 |
/test tide ?? |
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 need to try this, I am confused by my own math.
"github.com/onsi/ginkgo" | ||
) | ||
|
||
// makePodToVerifyCgroups returns a pod that verifies the existence of the specified cgroups. |
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.
nit: "makePodToVerifyCgroupSize"
podUID string | ||
handler string | ||
) | ||
ginkgo.By("Creating a RuntimeClass with Overhead definied", 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.
nit: "defined"
}) | ||
ginkgo.By("Checking if the pod cgroup was created appropriately", func() { | ||
cgroupsToVerify := []string{"pod" + podUID} | ||
pod := makePodToVerifyCgroupSize(cgroupsToVerify, "30000", "251658240") |
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.
just tracking my mental math...
200m+100m=300m cpu
3000 * 1024 / 1000 = 3072
is what i would have expected for cpu.
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.
this is checking cpu.cfs_quota_us
not cpu.shares
. however, this test should also check cpu.shares
.
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.
That would be if you were checking shares, which isn't the relevant setting. Kubelet will set cpu.cfs_quota_us to enforce the CPU limit (which should correspond to the total limits+pod overhead) -- see the check at [1].
CPU quota is based relative to a period (set to 100,000), so we are checking for 30,000, which shows a limiting to effectively. 300 milliCPU.
[1] - https://github.com/kubernetes/kubernetes/pull/88558/files#diff-c3ca917e18d307eabb48f941504b035eR53
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.
Shameless plug to gist @mcastelino put together, discussing shares v. quota: https://gist.github.com/mcastelino/b8ce9a70b00ee56036dadd70ded53e9f#what-happens
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. I saw CFS and mentally said shares and started doing math. Value for quota is right.
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Adds e2e_node test for the PodOverhead feature, and helps ensure this feature behaves as expected.