Skip to content

Conversation

ialidzhikov
Copy link
Member

@ialidzhikov ialidzhikov commented Jul 8, 2025

How to categorize this PR?

/area auto-scaling
/kind enhancement

What this PR does / why we need it:
The vpa-recommender has the following known limitation:

VPA recommendation might exceed available resources (e.g. Node size, available
size, available quota) and cause pods to go pending. [...]

In order to address this limitation, the following enhancement was contributed to the upstream: kubernetes/autoscaler#7560. It allows to globally (on vpa-recommdender level) cap the maximum allowed recommendation the vpa-recommender can recommend for a container. In this way, the vpa-recommender can be made aware of the cluster limits by configuring the global maximum allowed to the largest Node's allocatable. Fore more details, see the Specifying global maximum allowed resources to prevent pods from being unschedulable.

Which issue(s) this PR fixes:
N/A

Special notes for your reviewer:
This PR is resolves the Prevent Pod Scheduling Issues Due To Overscaling topic from the Gardener Hackathon 12/2024.

An old PR which tried to solve the same problem but the implementation proposal got rejected: #10413

Release note:

The Shoot resource does now support configuring the global maximum allowed resources the vpa-recommender can recommend for a container. The corresponding upstream configuration option solves a known limitation of vpa-recommender where it can make a Pod unschedulable by recommending resource requests more than largest Node's allocatable. For more details, see [Specifying global maximum allowed resources to prevent pods from being unschedulable](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/docs/examples.md#specifying-global-maximum-allowed-resources-to-prevent-pods-from-being-unschedulable).
The Seed and Garden resources do now support configuring the global maximum allowed resources the vpa-recommender can recommend for a container. The corresponding upstream configuration option solves a known limitation of vpa-recommender where it can make a Pod unschedulable by recommending resource requests more than largest Node's allocatable. For more details, see [Specifying global maximum allowed resources to prevent pods from being unschedulable](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/docs/examples.md#specifying-global-maximum-allowed-resources-to-prevent-pods-from-being-unschedulable).

Copy link
Contributor

gardener-prow bot commented Jul 8, 2025

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

@gardener-prow gardener-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/enhancement Enhancement, improvement, extension cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 8, 2025
@gardener-prow gardener-prow bot requested review from LucaBernstein and marc1404 July 8, 2025 14:30
@gardener gardener deleted a comment from gardener-prow bot Jul 8, 2025
@ialidzhikov ialidzhikov added the area/auto-scaling Auto-scaling (CA/HPA/VPA/HVPA, predominantly control plane, but also otherwise) related label Jul 8, 2025
@gardener-prow gardener-prow bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 8, 2025
@ialidzhikov ialidzhikov force-pushed the enh/vpa-max-allowed branch 3 times, most recently from 9e593ab to 54695de Compare July 9, 2025 11:04
@gardener-prow gardener-prow bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 9, 2025
@ialidzhikov ialidzhikov marked this pull request as ready for review July 9, 2025 12:49
@gardener-prow gardener-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 9, 2025
@gardener-prow gardener-prow bot requested review from oliver-goetz and vitanovs July 9, 2025 12:50
@ialidzhikov ialidzhikov force-pushed the enh/vpa-max-allowed branch from 13e8362 to 995e015 Compare July 9, 2025 13:30
@ialidzhikov
Copy link
Member Author

FYI @tobschli @dergeberl

@plkokanov
Copy link
Contributor

/assign

@tobschli
Copy link
Member

/assign

@ialidzhikov
Copy link
Member Author

/assign @vitanovs

@gardener-prow gardener-prow bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 15, 2025
@ialidzhikov
Copy link
Member Author

ialidzhikov commented Jul 16, 2025

I start the rebase now. Wish me luck 🤞

Copy link
Member

@vitanovs vitanovs left a comment

Choose a reason for hiding this comment

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

Thanks for the comprehensive PR and the well structured commit history, it definitely helped a lot while reviewing!

Tested the change locally with a resource-consumer deployment, everything sets up correctly and the vpa-recommender gets deployed with both ( or one, depending on the config ) additional container arguments.

/lgtm

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jul 16, 2025
@ialidzhikov ialidzhikov force-pushed the enh/vpa-max-allowed branch from e65fbf6 to fed9587 Compare July 23, 2025 05:05
@gardener-prow gardener-prow bot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 23, 2025
Copy link
Member Author

@ialidzhikov ialidzhikov left a comment

Choose a reason for hiding this comment

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

/approve

Copy link
Contributor

gardener-prow bot commented Jul 23, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ialidzhikov, vitanovs

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

@gardener-prow gardener-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 23, 2025
Copy link
Member

@tobschli tobschli left a comment

Choose a reason for hiding this comment

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

Thank you very much for the PR 😊
/lgtm

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jul 29, 2025
Copy link
Contributor

gardener-prow bot commented Jul 29, 2025

LGTM label has been added.

Git tree hash: c58b31a10d6239720cb40e702c40e6e573ff6a23

@ialidzhikov
Copy link
Member Author

/test pull-gardener-e2e-kind-gardenadm

@gardener-prow gardener-prow bot merged commit 41ddb66 into gardener:master Jul 29, 2025
19 checks passed
@ialidzhikov ialidzhikov deleted the enh/vpa-max-allowed branch August 13, 2025 06:47
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/auto-scaling Auto-scaling (CA/HPA/VPA/HVPA, predominantly control plane, but also otherwise) related cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/enhancement Enhancement, improvement, extension lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants