Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[InPlacePodVerticalScaling] Support in-place pod resize of non-sidecar initContainers#137352

Draft
natasha41575 wants to merge 4 commits intokubernetes:masterfrom
natasha41575:nonsidecarinitctrs
Draft

[InPlacePodVerticalScaling] Support in-place pod resize of non-sidecar initContainers#137352
natasha41575 wants to merge 4 commits intokubernetes:masterfrom
natasha41575:nonsidecarinitctrs

Conversation

@natasha41575
Copy link
Contributor

@natasha41575 natasha41575 commented Mar 2, 2026

What type of PR is this?

/kind feature

What this PR does / why we need it:

Support in-place pod resize of non-sidecar initContainers.

This is a pretty straightforward change. The machinery is more or less all there already so it's mostly a matter of relaxing the validation checks at the various layers.

The commits:

  1. Relax the API validation that prohibits non-sidecar initContainers from being resized.
  2. There is a RestartPolicy that can be defined at the pod-level, and is applicable only when a container does not define its own RestartPolicy. There is currently a validation check that ensures that a ResizePolicy for a container cannot be RestartRequired of the pod-level restart policy is Never. Analogously, I have added a validation check to ensure that a ResizePolicy for a container cannot be RestartRequired of that container's restart policy is Never.
  3. Kubelet resize allocation check that fails for non-sidecar initContainers is relaxed. Kubelet resize actuation logic is modified to stop ignoring running non-sidecar initContainers.
  4. E2E test and required updates to the E2E testing helpers.

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Support in-place pod resize of non-sidecar initContainers.

Leaving as a draft while I run a few more manual tests and walk through the actuation logic more carefully

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Mar 2, 2026
@natasha41575
Copy link
Contributor Author

/test all

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 2, 2026
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Details

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.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Mar 2, 2026
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

The full list of commands accepted by this bot can be found here.

Details 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

@k8s-ci-robot k8s-ci-robot added area/kubelet area/test sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Mar 2, 2026
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Mar 2, 2026
@github-project-automation github-project-automation bot moved this to Needs Triage in SIG Apps Mar 2, 2026
@k8s-ci-robot k8s-ci-robot requested a review from deads2k March 2, 2026 23:14
@k8s-ci-robot k8s-ci-robot requested a review from matthyx March 2, 2026 23:14
}
if !m.computePodResizeAction(ctx, pod, i, true, status, changes) {
// computePodResizeAction updates 'changes' if resize policy requires restarting this container
break
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the diff view makes it hard to tell what was changed here. I just moved this outside of the if podutil.IsRestartableInitContainer block

@k8s-ci-robot
Copy link
Contributor

@natasha41575: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-unit a55664a link true /test pull-kubernetes-unit
pull-kubernetes-unit-windows-master a55664a link false /test pull-kubernetes-unit-windows-master
pull-kubernetes-e2e-kind a55664a link true /test pull-kubernetes-e2e-kind
pull-kubernetes-node-e2e-containerd a55664a link true /test pull-kubernetes-node-e2e-containerd
pull-kubernetes-e2e-gce a55664a link true /test pull-kubernetes-e2e-gce

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.

Details

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/kubelet area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants