Skip to content

OCPBUGS-52169: Workload partitioning of static init containers #2224

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MarSik
Copy link

@MarSik MarSik commented Feb 28, 2025

What type of PR is this?

/kind bug

What this PR does / why we need it:

The pod modification routine that prepares containers for Workload Partitioning quits early when it encounters a container with no resources specified.

This causes a logical leak of resource capacity on the node, because the Pod is left untouched and still reports its full resource requests to the scheduler. It is however not using them, because the logic that moves the container to the management partitions works just fine.

The end result is lowered node capacity for scheduling.

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/OCPBUGS-52169

Special notes for your reviewer:

Modifies existing downstream only code.

Does this PR introduce a user-facing change?

Workload partitioning on a multi node cluster now properly configures static pods (etcd, keepalived, ...) with best effort init containers to not allocate resources.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

Related to GAd https://github.com/openshift/enhancements/blob/master/enhancements/workload-partitioning/management-workload-partitioning.md#api-server-admission-hook


@openshift-ci-robot openshift-ci-robot added the backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. label Feb 28, 2025
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 28, 2025
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Feb 28, 2025
@openshift-ci-robot
Copy link

@MarSik: This pull request references Jira Issue OCPBUGS-52169, which is invalid:

  • expected the bug to target the "4.19.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

What type of PR is this?

/kind bug

What this PR does / why we need it:

The pod modification routine that prepares containers for Workload Partitioning quits early when it encounters a container with no resources specified.

This causes a logical leak of resource capacity on the node, because the Pod is left untouched and still reports its full resource requests to the scheduler. It is however not using them, because the logic that moves the container to the management partitions works just fine.

The end result is lowered node capacity for scheduling.

Which issue(s) this PR fixes:

Fixes https://issues.redhat.com/browse/OCPBUGS-52169

Special notes for your reviewer:

Modifies existing downstream only code.

Does this PR introduce a user-facing change?

Workload partitioning on a multi node cluster now properly configures static pods (etcd, keepalived, ...) with best effort init containers to not allocate resources.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

Related to GAd https://github.com/openshift/enhancements/blob/master/enhancements/workload-partitioning/management-workload-partitioning.md#api-server-admission-hook


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.

@openshift-ci-robot
Copy link

@MarSik: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@openshift-ci openshift-ci bot requested review from rphillips and sjenning February 28, 2025 10:24
@MarSik
Copy link
Author

MarSik commented Feb 28, 2025

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Feb 28, 2025
@openshift-ci-robot
Copy link

@MarSik: This pull request references Jira Issue OCPBUGS-52169, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.19.0) matches configured target version for branch (4.19.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @sergiordlr

In response to this:

/jira refresh

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.

@openshift-ci openshift-ci bot requested a review from sergiordlr February 28, 2025 10:24
@MarSik MarSik force-pushed the fix-wp-static-init branch from 75934a8 to 5b4180c Compare February 28, 2025 11:46
@openshift-ci-robot
Copy link

@MarSik: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@@ -481,15 +541,24 @@ func TestStaticPodManaged(t *testing.T) {
if container.Resources.Requests.Cpu().String() != "0" && !tc.isGuaranteed {
t.Errorf("cpu requests should be 0 got %v", container.Resources.Requests.Cpu().String())
}
if container.Resources.Requests.Memory().String() == "0" && !tc.isGuaranteed {
if container.Resources.Requests.Memory().String() == "0" && !tc.isGuaranteed && !tc.isBestEffort {
t.Errorf("memory requests were %v but should be %v", container.Resources.Requests.Memory().String(), container.Resources.Requests.Memory().String())
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I did not touch this, but the Errorf is broken, it uses the same value for both the left and the right side.

@MarSik MarSik force-pushed the fix-wp-static-init branch from 5b4180c to 08c1486 Compare February 28, 2025 11:55
@openshift-ci-robot
Copy link

@MarSik: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@haircommander
Copy link
Member

note: the commit needs UPSTREAM: <carry>: prefixing it, the PR can just have OCPBUGS-52169: Workload...

overall this makes sense to me

@haircommander
Copy link
Member

@rphillips @mrunalp PTAL

…t containers

The pod modification routine that prepares containers for Workload
Partitioning quits early when it encounters a container with no
resources specified.

This causes a logical leak of resource capacity on the node,
because the Pod is left untouched and still reports its full
resource requests to the scheduler. It is however not using them,
because the logic that moves the container to the management
partitions works just fine.

The end result is lowered node capacity for scheduling.

Signed-off-by: Martin Sivak <[email protected]>
@MarSik MarSik force-pushed the fix-wp-static-init branch from 08c1486 to 9f2c1a5 Compare March 3, 2025 07:33
@openshift-ci-robot
Copy link

@MarSik: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@MarSik
Copy link
Author

MarSik commented Mar 3, 2025

/retitle OCPBUGS-52169: Workload partitioning of static init containers

@openshift-ci openshift-ci bot changed the title OCPBUGS-52169: <carry>: Workload partitioning of static init containers OCPBUGS-52169: Workload partitioning of static init containers Mar 3, 2025
@MarSik
Copy link
Author

MarSik commented Mar 3, 2025

@browsell @imiller0

@MarSik
Copy link
Author

MarSik commented Mar 5, 2025

/retest-required

Copy link

openshift-ci bot commented Mar 5, 2025

@MarSik: 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.

@rphillips
Copy link

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 19, 2025
Copy link

openshift-ci bot commented Mar 19, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: MarSik, rphillips
Once this PR has been reviewed and has the lgtm label, please assign mrunalp for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment


// When both cpu and memory requests are missing, there is nothing
// to do
if !cpuOk && !memoryOk {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this missing the case where only limits are set and requests are implied from limits?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants