Skip to content
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

Allow mutating priority classes #4129

Closed
wants to merge 1 commit into from

Conversation

wackxu
Copy link

@wackxu wackxu commented Jul 20, 2023

take over #2851 and Push this feature forward

  • One-line PR description: Allow mutating priority classes

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 20, 2023
@k8s-ci-robot k8s-ci-robot added kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory 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. labels Jul 20, 2023
@wackxu
Copy link
Author

wackxu commented Jul 20, 2023

You are the author of this proposal, could you help review or give some suggestions?
/assign @ravisantoshgudimetla

@wackxu
Copy link
Author

wackxu commented Jul 20, 2023

/assign @alculquicondor

@alculquicondor
Copy link
Member

you should start a new KEP

@wackxu wackxu force-pushed the allowupdatepriorityclass branch from c5873ef to 81ed9ad Compare July 22, 2023 10:56
@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 Jul 22, 2023
@wackxu wackxu force-pushed the allowupdatepriorityclass branch 2 times, most recently from 53aefa8 to da8c5e0 Compare July 22, 2023 11:00
@wackxu wackxu force-pushed the allowupdatepriorityclass branch from da8c5e0 to 1185c19 Compare September 16, 2023 09:45
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wackxu
Once this PR has been reviewed and has the lgtm label, please ask for approval from alculquicondor and additionally assign wojtek-t for approval. For more information see the Kubernetes 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

@wackxu wackxu force-pushed the allowupdatepriorityclass branch from 1185c19 to 4857d68 Compare September 16, 2023 09:53
Signed-off-by: wackxu <xushiwei5@huawei.com>
@wackxu wackxu force-pushed the allowupdatepriorityclass branch from 4857d68 to c2a5194 Compare September 16, 2023 10:01
@wackxu
Copy link
Author

wackxu commented Sep 16, 2023

you should start a new KEP

Done, /assign @Huang-Wei @kerthcet

@wackxu
Copy link
Author

wackxu commented Sep 23, 2023

Hi @alculquicondor @Huang-Wei @ahg-g Could you take a look at this? Since It is a small change to loose the validation of priority class

@Huang-Wei
Copy link
Member

/assign

@alculquicondor
Copy link
Member

/unassign

Comment on lines +157 to +158
At present, we cannot update the priorityClass value directly. This enhancement proposes
to relax update validation on priorityClass and make priorityClass value to be mutable.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
At present, we cannot update the priorityClass value directly. This enhancement proposes
to relax update validation on priorityClass and make priorityClass value to be mutable.
This enhancement proposes to make PriorityClass's `value` field mutable.


## Motivation

We'd like priority classes value to be mutable going from release 1.29 because of we're technically achieving the
Copy link
Member

Choose a reason for hiding this comment

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

Avoid mentioning release info here. That's part of the metadata file (kep.yaml).

same effect with re-creation. Reasons for making priority classes immutable are mentioned in this
[proposal](https://github.com/kubernetes/design-proposals-archive/blob/main/scheduling/pod-priority-api.md#drawbacks-of-changing-priority-classes).
But we noticed that people are anyways deleting/creating priority classes despite the reasons mentioned above.
While the deletion and re-creation seems like lesser of both the evils, our experience says that the deletion
Copy link
Member

Choose a reason for hiding this comment

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

In a motivation section, I think you should elaborate why recreating PriorityClass is necessary here, like what's radical problems end-users stomped on and they have to recreate.

Only by clarifying the fundamental use cases, we can know whether making PC's value field mutable is the right approach. Maybe PC is not the problem realm.

But we noticed that people are anyways deleting/creating priority classes despite the reasons mentioned above.
While the deletion and re-creation seems like lesser of both the evils, our experience says that the deletion
and re-creation of priority classes is more dangerous and error prone, considering people might delete another
priority class, instead of doing just an update where an update can be rejected if there is a name mismatch or
Copy link
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 I fully understand "re-creation of priority classes is more dangerous and error prone". Are you trying to say PC might be deleted by manual mistake like typo, while update is safer upon typo-ed PC name? If so, I don't think it's a strong motivation.

For some integrators (not default scheduler), they may rely on PriorityClass deletion to
trigger some customized behavior (like recreating/updating pending pods). This proposal may get them impacted.

## Design Details
Copy link
Member

Choose a reason for hiding this comment

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

I think some aspects need to illustrated:

  • will PC's admission plugin's logic change? do pods carry pre-updated PC's value get populated after PC's update? if so, does it impact unschedulable pods only?
  • is system/cluster reserved PC mutable? (although you gave a snippet, but it's always better illustrated it explicitly)
  • clear document that other fields like preemptionPolicy is still immutable

Copy link
Member

@kerthcet kerthcet left a comment

Choose a reason for hiding this comment

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

I think we need more work on this especially the use cases and motivations? 🤔

### Non-Goals

- Allow mutating priorityClass other immutable filed like `PreemptionPolicy`
- Change the priority of running or pending pods when changing the priority value of a priority class
Copy link
Member

Choose a reason for hiding this comment

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

Can you also sort out the risks to running pods with the changed priority. Maybe at the ### Risks and Mitigations


#### Story 1

As a cluster administrator, I wish I could directly adjust the priority class value instead of re-creation.
Copy link
Member

Choose a reason for hiding this comment

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

I'm not quite convinced by this use case because I hope we can have a real case here rather than just emphasizing that I want it. You can explain in which case you want to adjust the priority class directly and what we can benefit from it.

More stories is also welcomed.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 22, 2024

## Summary

At present, we cannot update the priorityClass value directly. This enhancement proposes
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
At present, we cannot update the priorityClass value directly. This enhancement proposes
At present, we cannot update the `value` of a PriorityClass directly. This enhancement proposes

@wojtek-t wojtek-t self-assigned this Feb 1, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 2, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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 lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

9 participants