Skip to content

Conversation

@omerap12
Copy link
Member

@omerap12 omerap12 commented Jan 1, 2026

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds --in-place-skip-disruption-budget flag that skips disruption budget checks for in-place pod updates when all containers have NotRequired resize policy. This allows non-disruptive in-place updates to proceed without being throttled by eviction tolerance, while still respecting disruption budgets for RestartContainer resize policy.

Which issue(s) this PR fixes:

Fixes #8980

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Adds --in-place-skip-disruption-budget flag that skips disruption budget checks for in-place pod updates when all containers have NotRequired resize policy

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

NONE

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area area/vertical-pod-autoscaler labels Jan 1, 2026
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: omerap12

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

The pull request process is described 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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 1, 2026
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed do-not-merge/needs-area labels Jan 1, 2026
@omerap12
Copy link
Member Author

omerap12 commented Jan 1, 2026

/cc @maxcao13 @adrianmoisey

return &r
}

func (pb *podBuilderImpl) WithContainerResizePolicy(containerName string, resizePolicy []apiv1.ContainerResizePolicy) PodBuilder {
Copy link
Member

Choose a reason for hiding this comment

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

Does it not make sense to add this to the containerBuilder struct?
Somewhere here: https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/pkg/utils/test/test_container.go

Copy link
Member Author

Choose a reason for hiding this comment

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

I actually started adding this to the containerBuilder struct, but then I thought it might be unnecessary in the future. That said, since you mentioned it, it probably does make sense to include it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, makes much more sense. done :)

Comment on lines 78 to 84
inPlaceSkipDisruptionBudget = flag.Bool(
"in-place-skip-disruption-budget",
false,
"If true, VPA updater skips disruption budget checks for in-place pod updates when all containers have NotRequired resize policy or no policy. "+
"Disruption budgets are still respected when any container has RestartContainer resize policy.",
)

Copy link
Member

Choose a reason for hiding this comment

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

I think we might have to say that it only skips if all containers have NotRequired for both cpu and memory resources as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree. will fix

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Comment on lines +45 to +46
// TODO(omerap12): do we want to check here for InitContainers/InitContainers+restartPolicy Always/
// Also check init containers if they can be resized
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason to specially handle this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently the VPA does not support native sidecar (ref: #7229) so in the current implementation I am not checking those

@omerap12 omerap12 force-pushed the issue-8980 branch 2 times, most recently from 00d9e72 to 3f857bf Compare January 4, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/vertical-pod-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VPA - Relax pod disruption budget logic for in-place updates when container resize policy is NotRequired

4 participants