Skip to content

KEP-5729: Update ResourceClaim Support for Workloads for beta in 1.37 - #5976

Merged
k8s-ci-robot merged 3 commits into
kubernetes:masterfrom
nojnhuh:5729-impl-update
Jun 16, 2026
Merged

KEP-5729: Update ResourceClaim Support for Workloads for beta in 1.37#5976
k8s-ci-robot merged 3 commits into
kubernetes:masterfrom
nojnhuh:5729-impl-update

Conversation

@nojnhuh

@nojnhuh nojnhuh commented Mar 23, 2026

Copy link
Copy Markdown
Contributor
  • One-line PR description: Update KEP-5729 (DRA: ResourceClaim Support for Workloads) for beta promotion in Kubernetes 1.37.
  • Other comments:

@k8s-ci-robot k8s-ci-robot added the kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory label Mar 23, 2026
@k8s-ci-robot
k8s-ci-robot requested review from dom4ha and macsko March 23, 2026 21:30
@k8s-ci-robot k8s-ci-robot added the sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. label Mar 23, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in SIG Scheduling Mar 23, 2026
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 23, 2026

@pohly pohly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As documentation for what was in 1.36 this is ready for merging, with the caveat about "implemented".

We were discussing changes the behavior when kube-controller-manager has the feature off (default in 1.36) and is running with an apiserver where it's on (say, on the transition to default enabled). We could include that change in this PR in a second commit, then we only need to review one PR - up to you.

Comment thread keps/sig-scheduling/5729-resourceclaim-support-for-workloads/kep.yaml Outdated
@nojnhuh

nojnhuh commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

We were discussing changes the behavior when kube-controller-manager has the feature off (default in 1.36) and is running with an apiserver where it's on (say, on the transition to default enabled). We could include that change in this PR in a second commit, then we only need to review one PR - up to you.

Added as a second commit here.

@dom4ha dom4ha changed the title KEP-5729: Update based on 1.36 implementation KEP-5729: Update ResourceClaim Support for Workloads based on 1.36 implementation May 4, 2026
@nojnhuh

nojnhuh commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

I updated this to include the required beta criteria in hopes of promoting this for 1.37.

/retitle KEP-5729: Update for beta in 1.37

@k8s-ci-robot k8s-ci-robot changed the title KEP-5729: Update ResourceClaim Support for Workloads based on 1.36 implementation KEP-5729: Update for beta in 1.37 May 11, 2026
@nojnhuh

nojnhuh commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

/retitle KEP-5729: Update ResourceClaim Support for Workloads for beta in 1.37

@k8s-ci-robot k8s-ci-robot changed the title KEP-5729: Update for beta in 1.37 KEP-5729: Update ResourceClaim Support for Workloads for beta in 1.37 May 11, 2026
Comment thread keps/prod-readiness/sig-scheduling/5729.yaml
Comment on lines 843 to +846
Generated and standalone ResourceClaims referenced by a PodGroup remain
unallocated until kube-scheduler allocates the ResourceClaim by setting
`status.allocation` for the first Pod in the PodGroup that references the
PodGroup's claim. When a Pod's claim is requested through
`podGroupResourceClaim`, the ResourceClaim's `status.reservedFor` list will
PodGroup's claim. When a Pod's claim matches a claim made by its PodGroup,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mm4tt @wojtek-t Is the PodGroup scheduling cycle ready to be plugged into with things like DRA for 1.37? Should we reconsider changing the ResourceClaim from being allocated with the first Pod to being allocated with the PodGroup?

Pros of allocating with the first Pod:

  • Resources stay unallocated until a Pod is created which uses the claim. Useful if PodGroups are created with 0 replicas and stay that way for a while.
  • That's what we already do :)

Pros of allocating with the PodGroup:

cc @johnbelamaric

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we reconsider changing the ResourceClaim from being allocated with the first Pod to being allocated with the PodGroup?

I'd treat it as an implementation detail. I assume that we won't change the behavior even after introducing PodGroup level extension points.

In 1.38 we may consider the migration, which should give us support for ResourceClaim in CompositePodGroup for free.

@wojtek-t @mm4tt

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 - there are so many moving bits now that I wouldn't attach it now.
Let's get back to this in 1.38 timeframe an reconsider this decision.

@johnbelamaric johnbelamaric Jun 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does pushing this change to 1.38 delay the beta? ie, should this integration be a beta criteria?

I obviously would like to take this to beta in 1.37 but this is really up to SIG scheduling approvers and I defer to you.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure it has to be. For me this is an implementation detail.
Such change should be gated on its own (so we shouldn't make it as part of GA graduation), but I can imagine this happening as a second beta or even a follow-up.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There's no guarantee we won't encounter something unexpected the next release, but I can't come up with any obvious problem at the moment, so I'd say that beta promotion is fine.

My current understanding is that PodGroup scheduling is tightly coupled with its pods scheduling. Even a PodGroup with Basic scheduling policy won't be scheduled until the first pod is scheduled. Switching to PodGroup extension points may even not give us any reliability gain, as the PodGroup may be rescheduled when new pods appear, so we may need to face exactly the same edge cases.

So from the user POV, there should be no visible changes.

Comment thread keps/sig-scheduling/5729-resourceclaim-support-for-workloads/README.md Outdated
Comment thread keps/sig-scheduling/5729-resourceclaim-support-for-workloads/README.md Outdated
@nojnhuh

nojnhuh commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

/hold to squash fixups

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 3, 2026
are missing a bunch of machinery and tooling and can't do that now.
-->

New automated upgrade/downgrade tests will verify:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I started working on a test for this but I'm not sure if it's feasible to implement now since 1.36 serves only the v1alpha2 version of the PodGroup API where 1.37 instead serves v1alpha3 (and eventually v1beta1). Do we have to wait until both the old and new versions serve the same API version?

Is there some other functionality we could test here that doesn't depend on the PodGroup persisting across upgrade/downgrade?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's not bother about automated test for now - manual one with described scenario is probably good enough for now.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, I'll add more detail here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Does the v1alpha2 -> v1alpha3 transition prevent even testing this manually though if a PodGroup can't survive transitions between 1.36 and 1.37?

Pods are actually consuming the ResourceClaim without the explicit list in
`status.reservedFor` list and therefore it will not be safe to deallocate.

- Now the DRA plugin reuses the scheduler's internal view of PodGroups to

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We are introducing PodGroup level PostFilter in Workload Aware Preemption KEP (beta) and disable pod-by-pod one (See #6106 (comment)).

Shall we make the migration and support deallocation a part of this KEP?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'll update this.

To make sure I'm understanding, the pod-by-pod PostFilter will still run for pods outside PodGroups, but only the PodGroup PostFilter will run for pods in a group? And the DRA plugin's PodGroup PostFilter will do mostly the same things as its per-pod PostFilter, but will go further than only unreserving the claim for the PodGroup and deallocate the ResourceClaim?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Pushed an update. I moved everything about PostFilter into the "Deallocate" section and added implementing the PodGroup-level PostFilter with deallocation for PodGroup claims.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To make sure I'm understanding, the pod-by-pod PostFilter will still run for pods outside PodGroups, but only the PodGroup PostFilter will run for pods in a group?

Yes

And the DRA plugin's PodGroup PostFilter will do mostly the same things as its per-pod PostFilter, but will go further than only unreserving the claim for the PodGroup and deallocate the ResourceClaim

I thought that for the initial implementation of DRA PodGroupPostFilter, that we need to do when introducing PodGroupPostFilter extension point, we would do basically the same thing as we do in current post filters. We would gather the unavailableClaims for pods from PodGroup in podGroupCycleState and in PodGroupPostFilter we would randomly deallocate one of them.

My understanding is that as part of this KEP you would also like to extend this logic and deallocate pod group level claims, right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I thought that for the initial implementation of DRA PodGroupPostFilter, that we need to do when introducing PodGroupPostFilter extension point, we would do basically the same thing as we do in current post filters. We would gather the unavailableClaims for pods from PodGroup in podGroupCycleState and in PodGroupPostFilter we would randomly deallocate one of them.

We probably need to do it as a part of KEP-5710: Workload-Aware Preemption KEP as the changes needs to be under GenericWorkload feature gate (as it's a beta blocker for Gang Scheduling and WAP), but we can accept your contribution @nojnhuh if you are willing to do so.

My understanding is that as part of this KEP you would also like to extend this logic and deallocate pod group level claims, right?

Yes, deallocation would be in turn part of this KEP beta promotion, as we should have all data on the PodGroup level at the time the PostFilter is called.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Jun 9, 2026

@wojtek-t wojtek-t left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just some minor comments from PRR perspective - other than that LGTM.

Comment thread keps/sig-scheduling/5729-resourceclaim-support-for-workloads/README.md Outdated
Comment thread keps/sig-scheduling/5729-resourceclaim-support-for-workloads/README.md Outdated

- [X] Feature gate (also fill in values in `kep.yaml`)
- Feature gate name: WorkloadPodGroupResourceClaimTemplate
- Feature gate name: DRAWorkloadResourceClaims

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since I can't comment on the unchanged line:

Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?

If the kubelet restarts with the feature disabled, existing containers continue to run with all of their allocated devices, including those from claims made by their PodGroup when the feature was enabled.

Can you clarify how that works? Isn't kubelet performing a regular admission of pods after restart, and then (given it no longer understands that the pod is referencing the claim), rejects it?

Are there any tests for feature enablement/disablement?

Were those added? Can you please add links?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?

If the kubelet restarts with the feature disabled, existing containers continue to run with all of their allocated devices, including those from claims made by their PodGroup when the feature was enabled.

Can you clarify how that works? Isn't kubelet performing a regular admission of pods after restart, and then (given it no longer understands that the pod is referencing the claim), rejects it?

I can't find any indication that DRA is involved in (re-)admission. And as long as the Pod sandbox stays intact, the kubelet doesn't check the Pod's ResourceClaims again.

Are there any tests for feature enablement/disablement?

Were those added? Can you please add links?

I have an open PR to add this test in kubernetes/kubernetes#138363: https://github.com/kubernetes/kubernetes/pull/138363/changes#diff-d7f29364819f5cc467bdc62b18a49db19c3f02fdffb8f3d202e7978a2ce03c0d

I'll follow up to add a link here once it's merged.

are missing a bunch of machinery and tooling and can't do that now.
-->

New automated upgrade/downgrade tests will verify:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@nojnhuh

nojnhuh commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

/wg device-management

@k8s-ci-robot k8s-ci-robot added the wg/device-management Categorizes an issue or PR as relevant to WG Device Management. label Jun 15, 2026
@wojtek-t

Copy link
Copy Markdown
Member

@nojnhuh - the robot is complaining about commit messages, please fix

@helayoty helayoty moved this from Needs Triage to Needs Review in SIG Scheduling Jun 16, 2026
@pohly pohly moved this from 🆕 New to 👀 In review in Dynamic Resource Allocation Jun 16, 2026
@nojnhuh
nojnhuh force-pushed the 5729-impl-update branch from aa5f43b to 98a28e3 Compare June 16, 2026 15:36
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Jun 16, 2026
@nojnhuh

nojnhuh commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@nojnhuh - the robot is complaining about commit messages, please fix

Done

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 16, 2026
@wojtek-t

Copy link
Copy Markdown
Member

I'm fine with that from PRR perspective, but it still requires SIG approval.

/approve PRR

@dom4ha

dom4ha commented Jun 16, 2026

Copy link
Copy Markdown
Member

@nojnhuh please fix the wording about Unreserve vs PostFilter, but the rest looks good.

/approve

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dom4ha, nojnhuh, wojtek-t

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 Jun 16, 2026
@nojnhuh
nojnhuh force-pushed the 5729-impl-update branch from 98a28e3 to 6954eac Compare June 16, 2026 19:13

@dom4ha dom4ha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested to further change the wording, WDYT?

Comment thread keps/sig-scheduling/5729-resourceclaim-support-for-workloads/README.md Outdated
Comment thread keps/sig-scheduling/5729-resourceclaim-support-for-workloads/README.md Outdated
@nojnhuh
nojnhuh force-pushed the 5729-impl-update branch from 6954eac to 1203516 Compare June 16, 2026 19:33
@dom4ha

dom4ha commented Jun 16, 2026

Copy link
Copy Markdown
Member

Thanks @nojnhuh !
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 16, 2026
@k8s-ci-robot
k8s-ci-robot merged commit bf34c10 into kubernetes:master Jun 16, 2026
4 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.37 milestone Jun 16, 2026
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in SIG Scheduling Jun 16, 2026
@pohly pohly moved this from 👀 In review to ✅ Done in Dynamic Resource Allocation Jun 17, 2026
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. wg/device-management Categorizes an issue or PR as relevant to WG Device Management.

Projects

Status: ✅ Done
Archived in project

Development

Successfully merging this pull request may close these issues.

10 participants