Skip to content

DNM: feat: Add MutablePodResourcesForSuspendedJobs feature gate #132441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kannon92
Copy link
Contributor

  • Add feature gate to control mutable pod resources for suspended jobs
  • Implement validatePodResourceUpdatesOnly function to allow only container resource updates
  • Update strategy validation to check feature gate and job state (suspended + not started)
  • Add comprehensive unit tests for feature gate functionality
  • Ensure backward compatibility when feature gate is disabled

This enables users to update container resources on suspended jobs that haven't started yet, while maintaining immutability for all other pod template fields.

What type of PR is this?

/kind feature

What this PR does / why we need it:

Which issue(s) this PR is related to:

Special notes for your reviewer:

Does this PR introduce a user-facing change?


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


@k8s-ci-robot
Copy link
Contributor

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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.

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jun 22, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject 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.

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.

@k8s-ci-robot k8s-ci-robot added 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. labels Jun 22, 2025
@k8s-ci-robot k8s-ci-robot requested review from deads2k and soltysh June 22, 2025 01:36
@k8s-ci-robot k8s-ci-robot added sig/apps Categorizes an issue or PR as relevant to SIG Apps. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jun 22, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in SIG Apps Jun 22, 2025
Copy link

@lmktfy lmktfy left a comment

Choose a reason for hiding this comment

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

Some of this validation could go into a highly recommended ValidatingAdmissionPolicy.

For example: we could say that shrinking limits and requests for a template is always OK, but restrict resizes that enlarge them.

💭 What would the authz look like for template changes?

@kannon92
Copy link
Contributor Author

Some of this validation could go into a highly recommended ValidatingAdmissionPolicy.

For example: we could say that shrinking limits and requests for a template is always OK, but restrict resizes that enlarge them.

💭 What would the authz look like for template changes?

Maybe. But right now, we are forbidding any resizing. So we could relax it in-tree and then leave it to people to implement their own VAP?

But that could lead to nobody implement this and then its free reign. So I'm not sure what is best here.

@kannon92 kannon92 force-pushed the poc-job-relax-pod-template branch from ffc331b to add236c Compare June 23, 2025 21:27
// kep: TBD
//
// Enables mutable pod resources for Jobs when the job is suspended.
MutableJobPodResourcesForSuspendedJobs featuregate.Feature = "MutableJobPodResourcesForSuspendedJobs"
Copy link
Contributor

Choose a reason for hiding this comment

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

/hold
I don't recall a KEP describing this, so putting here on hold, until there's a clear decision about the path forward.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, I am hoping to discuss with sig-apps and maybe have this for 1.35.

@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 26, 2025
- Add feature gate to control mutable pod resources for suspended jobs
- Implement validatePodResourceUpdatesOnly function to allow only container resource updates
- Update strategy validation to check feature gate and job state (suspended + not started)
- Add comprehensive unit tests for feature gate functionality
- Ensure backward compatibility when feature gate is disabled

This enables users to update container resources on suspended jobs that haven't started yet,
while maintaining immutability for all other pod template fields.

update feature gates
@kannon92 kannon92 force-pushed the poc-job-relax-pod-template branch from add236c to f49bc5f Compare June 28, 2025 15:50
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 28, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kannon92
Once this PR has been reviewed and has the lgtm label, please assign deads2k for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Jun 28, 2025
@k8s-ci-robot
Copy link
Contributor

@kannon92: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-verify 29a6007 link true /test pull-kubernetes-verify
pull-kubernetes-integration 29a6007 link true /test pull-kubernetes-integration

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/feature Categorizes issue or PR as related to a new feature. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/apps Categorizes an issue or PR as relevant to SIG Apps. 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.
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

4 participants