-
Notifications
You must be signed in to change notification settings - Fork 4.8k
[release-4.20] OCPNODE-3722: Add a test for NodeSizing default change to OCP 4.20 #30467
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
base: release-4.20
Are you sure you want to change the base?
[release-4.20] OCPNODE-3722: Add a test for NodeSizing default change to OCP 4.20 #30467
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ngopalak-redhat The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test all |
|
@ngopalak-redhat: This pull request references OCPNODE-3722 which is a valid jira issue. In response to this: 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@ngopalak-redhat: This pull request references OCPNODE-3722 which is a valid jira issue. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/retest-required |
|
@ngopalak-redhat: This pull request references OCPNODE-3722 which is a valid jira issue. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
@ngopalak-redhat: This pull request references OCPNODE-3722 which is a valid jira issue. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
@haircommander @sairameshv Here's the test for OCP 4.20 for auto-sizing config. It needed not hold on the patch as it tests the existing behavior which the patch should not change. |
test/extended/node/node_sizing.go
Outdated
|
|
||
| g.By("Waiting for worker MCP to start updating") | ||
| o.Eventually(func() bool { | ||
| mcp, err := mcClient.MachineconfigurationV1().MachineConfigPools().Get(ctx, "worker", metav1.GetOptions{}) |
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 think worker is too big of an MCP for this test. maybe create a new smaller MCP with one worker node, and only update that one?
test/extended/node/node_sizing.go
Outdated
| g.By("Creating a second privileged pod with /etc mounted to verify KubeletConfig was applied") | ||
| podName = "node-sizing-autosizing-test" | ||
|
|
||
| pod = &corev1.Pod{ |
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.
redefined?
test/extended/node/node_sizing.go
Outdated
| Image: "registry.k8s.io/e2e-test-images/agnhost:2.53", | ||
| Command: []string{"/bin/sh", "-c", "sleep 300"}, | ||
| SecurityContext: &corev1.SecurityContext{ | ||
| Privileged: func() *bool { b := true; return &b }(), |
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.
ptr.To(true)
|
/retest-required |
|
@ngopalak-redhat: This pull request references OCPNODE-3722 which is a valid jira issue. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
01e35bc to
e27355a
Compare
|
@ngopalak-redhat: all tests passed! Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
Summary
This PR introduces a new E2E test case to verify the behavior of the NODE_SIZING_ENABLED feature flag following the changes in openshift/machine-config-operator#5387. The primary goal is to ensure that while the patch introduces a new MachineConfig, it does not automatically disable a user's ability to enable node autosizing for reserved resources.
NOTE: maxRestartCountForFailures is measured over the ENTIRE test suite run, not at a fixed interval, For this test suite since the node restarts. The count is increased
Test Steps and Verification
The test case performs the following verifications:
Initial State Check:
A new MachineConfig (related to the patch) is applied.
The test then verifies that, by default, the /etc/node-sizing-enabled.env file on the host still contains NODE_SIZING_ENABLED=false.
Goal: Confirm the new MachineConfig does not inadvertently set this flag to true or prevent it from being set to false.
Enablement Check (Positive Verification):
A KubeletConfig resource is created to enable the auto-sizing reserved feature.
The test verifies that this action successfully overrides the default state and sets NODE_SIZING_ENABLED=true in the /etc/node-sizing-enabled.env file.
Goal: Ensure the MachineConfig patch does not block users from utilizing node autosizing when explicitly configured via KubeletConfig.
Implementation Details
The test utilizes a privileged pod to access the host filesystem (specifically
/etc/node-sizing-enabled.env) to directly read the value of the NODE_SIZING_ENABLED environment variable before and after the KubeletConfig application.This provides robust coverage to prevent a regression where the MCO patch could block or override user-configured autosizing.
Test Result with the PR: https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/logs/release-openshift-origin-installer-launch-aws-modern/1987358551382691840/artifacts/launch/openshift-e2e-test/artifacts/e2e.log
Run with clusterBot
Result:
Also to add without the patch the test is passing, which implies that patch does not change the current behavior of 4.20: