Skip to content

VPA updater: fix unready DaemonSet updates - #10141

Open
dippynark wants to merge 1 commit into
kubernetes:masterfrom
dippynark:vpa-updater-fix-unready-daemonset-updates
Open

VPA updater: fix unready DaemonSet updates#10141
dippynark wants to merge 1 commit into
kubernetes:masterfrom
dippynark:vpa-updater-fix-unready-daemonset-updates

Conversation

@dippynark

@dippynark dippynark commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

Currently if all DaemonSet Pods become not ready (for example, VPA scales memory limits down too low and they all start OOMing) then VPA cannot scale the Pods back up again due to the following error:

Failed to obtain replication info ... daemon set ... has no number ready pods

This is because we're looking at the wrong field in the DaemonSet status to determine the desired number of Pods. This PR fixes this by looking at daemonSet.Status.DesiredNumberScheduled instead of daemonSet.Status.NumberReady.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

NONE

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


Summary by CodeRabbit

  • Bug Fixes
    • Improved pod eviction decisions for DaemonSet-managed workloads by using the desired scheduled pod count.
    • Corrected behavior when DaemonSet pods are not yet ready, allowing eligible pods to be evaluated accurately.

@kubernetes-prow kubernetes-prow Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Aug 14, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dippynark
Once this PR has been reviewed and has the lgtm label, please assign omerap12 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

@kubernetes-prow kubernetes-prow Bot added the area/vertical-pod-autoscaler Issues or PRs related to the Vertical Pod Autoscaler component label Aug 14, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

This issue is currently awaiting triage.

If SIG Autoscaling contributors 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.

@kubernetes-prow kubernetes-prow Bot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 14, 2026
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6a194abc-cf04-4df1-ab7e-74b4bee96bde

📥 Commits

Reviewing files that changed from the base of the PR and between 5e07dd5 and 1b5df75.

📒 Files selected for processing (2)
  • vertical-pod-autoscaler/pkg/updater/restriction/pods_restriction_factory.go
  • vertical-pod-autoscaler/pkg/updater/restriction/pods_restriction_factory_test.go

📝 Walkthrough

Walkthrough

The updater now bases DaemonSet replica restrictions on Status.DesiredNumberScheduled. Tests cover DaemonSets with all scheduled pods ready and with none ready.

Changes

DaemonSet replica count correction

Layer / File(s) Summary
Scheduled count validation
vertical-pod-autoscaler/pkg/updater/restriction/pods_restriction_factory.go, vertical-pod-autoscaler/pkg/updater/restriction/pods_restriction_factory_test.go
getReplicaCount uses DesiredNumberScheduled and reports zero scheduled replicas. Table-driven tests cover ready and unready DaemonSet pods and verify eviction limits.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 1b5df

This localized fix changes DaemonSet replica information used by VPA updates; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: adrianmoisey, maxcao13, omerap12

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the DaemonSet unready-Pod handling fix, which is the main change in the pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kubernetes-prow

Copy link
Copy Markdown
Contributor

Hi @dippynark. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@kubernetes-prow kubernetes-prow Bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 14, 2026
@dippynark
dippynark force-pushed the vpa-updater-fix-unready-daemonset-updates branch from 0747c87 to ce97fba Compare August 14, 2026 14:22
@kubernetes-prow kubernetes-prow Bot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Aug 14, 2026
Signed-off-by: Luke Addison <lukeaddison785@gmail.com>
@dippynark
dippynark force-pushed the vpa-updater-fix-unready-daemonset-updates branch from d09826d to 1b5df75 Compare August 14, 2026 14:33
@dippynark
dippynark marked this pull request as ready for review August 14, 2026 14:34
@kubernetes-prow kubernetes-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 Aug 14, 2026
@kubernetes-prow
kubernetes-prow Bot requested a review from omerap12 August 14, 2026 14:35
@dippynark

Copy link
Copy Markdown
Contributor Author

/kind bug

@kubernetes-prow kubernetes-prow Bot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/vertical-pod-autoscaler Issues or PRs related to the Vertical Pod Autoscaler component cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant