Skip to content

Conversation

@natasha41575
Copy link
Contributor

@natasha41575 natasha41575 commented Mar 11, 2025

What type of PR is this?

/kind feature
/kind deprecation
/kind api-change

What this PR does / why we need it:

This PR deprecates the pod resizeStatus and exposes the status of a pod resize under pod conditions as described in https://kep.k8s.io/1287.

Which issue(s) this PR fixes:

Fixes #128922

Does this PR introduce a user-facing change?

The pod `status.resize` field is now deprecated and will no longer be set. The status of a pod resize will be exposed under two new conditions: `PodResizeInProgress` and `PodResizePending` instead. 

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

- [KEP]: https://kep.k8s.io/1287

@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 do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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. kind/feature Categorizes issue or PR as related to a new feature. kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/code-generation area/kubelet sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 11, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in SIG Apps Mar 11, 2025
@natasha41575 natasha41575 changed the title Pod resize conditions Move pod resize status to pod conditions Mar 11, 2025
@natasha41575 natasha41575 changed the title Move pod resize status to pod conditions [FG:InPlacePodVerticalScaling] Move pod resize status to pod conditions Mar 11, 2025
return false, v1.PodResizeStatusInfeasible, msg
kl.recorder.Eventf(pod, v1.EventTypeWarning, events.ResizeInfeasible, msg)
return false, &v1.PodCondition{
Type: v1.PodResizePending,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

was planning to add observedGeneration here after #130573 goes in (I can either update it in this PR or submit a follow up depending on which merges first)

@natasha41575
Copy link
Contributor Author

/test pull-kubernetes-node-kubelet-podresize

@bart0sh bart0sh moved this from Triage to Needs Reviewer in SIG Node: code and documentation PRs Mar 16, 2025
}

if oldConditionsCount != newConditionsCount {
return false
Copy link
Member

Choose a reason for hiding this comment

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

If the ResizePending condition was removed and replaced with a ResizeInProgress condition, wouldn't this still get skipped? We might need to create a set of types for each new condition, and fail if any old condition types are missing (or if the lengths differ).

@natasha41575 natasha41575 force-pushed the pod-resize-conditions branch 2 times, most recently from a0658cc to df8bbbd Compare March 17, 2025 21:42
@natasha41575 natasha41575 requested a review from tallclair March 17, 2025 21:42
}

if oldConditionsCount != newConditionsCount {
return false
Copy link
Member

Choose a reason for hiding this comment

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

No, the previous (already-existing) loop would catch that. In your example, it would see that ResizeInProgress is present on the new status, receive nil when it tries to fetch it from the old status, and subsequently return false.

Ah, makes sense. I missed that check.

actually I think your suggestion is (marginally) more efficient than what it does today actually, so I'll go ahead and make the change.

I'm not sure that's true, it's usually more efficient to search through a small slice than index it in a map. But let's not block on this...

@natasha41575 natasha41575 force-pushed the pod-resize-conditions branch from df8bbbd to a15520f Compare March 17, 2025 22:01
@tallclair
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 17, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: dae813c08e16badb500a41ebc5489576e9ca845b

@natasha41575
Copy link
Contributor Author

/test pull-kubernetes-node-kubelet-podresize

@natasha41575 natasha41575 requested a review from tallclair March 17, 2025 22:09
@thockin
Copy link
Member

thockin commented Mar 17, 2025

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: natasha41575, tallclair, thockin

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 17, 2025
@SergeyKanzhelev SergeyKanzhelev moved this from Triage to Archive-it in SIG Node CI/Test Board Mar 17, 2025
@k8s-ci-robot k8s-ci-robot merged commit 473ec01 into kubernetes:master Mar 17, 2025
16 of 17 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.33 milestone Mar 17, 2025
@github-project-automation github-project-automation bot moved this from Archive-it to Done in SIG Node CI/Test Board Mar 17, 2025
@github-project-automation github-project-automation bot moved this from Needs Reviewer to Done in SIG Node: code and documentation PRs Mar 17, 2025
@github-project-automation github-project-automation bot moved this from Needs Triage to Done in SIG Apps Mar 17, 2025
@github-project-automation github-project-automation bot moved this from Needs Triage to Done in SIG CLI Mar 17, 2025
@natasha41575 natasha41575 deleted the pod-resize-conditions branch March 18, 2025 15:38
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/code-generation area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/kubectl area/kubelet area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Projects

Archived in project
Archived in project
Archived in project

Development

Successfully merging this pull request may close these issues.

[FG:InPlacePodVerticalScaling] Revisit ResizeStatus and state transitions

7 participants