added preemmptable attribute into pod group
What this PR does
- Adds an optional
Preemptablefield toPodGroupSpecin the API and CRD. - Enables PodGroup-level control over preempt/reclaim actions.
- Enforces via webhook:
- If a PodGroup is preemptable, its Pods can be preemptable or not.
- If a PodGroup is un-preemptable, its Pods cannot be preemptable (checked in the admission webhook).
Special notes for your reviewer
- No changes to scheduler logic; enforcement is strictly at the webhook/admission level.
- Backward compatible:
Preemptableis optional and defaults to current behavior if unset.
API/CRD changes:
-
Preemptablefield added toPodGroupSpec(Go types and CRD schema).
Webhook changes:
- Pod admission webhook rejects Pods that are preemptable if their PodGroup is un-preemptable.
Fixes #2141
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
To complete the pull request process, please assign wangyang0616
You can assign the PR to them by writing /assign @wangyang0616 in a comment when ready.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
We should modify API repo first, and the behavior should be: preemptable filed of pg is nil or preemptable==true means pg can be preempted for compatibility.
@SuyashParmar: PR needs rebase.
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.