Repository navigation
feat(api): add PodGroup safeToDisrupt to opt out of consolidation - #22
Open
sam-huang1223 wants to merge 1 commit into
Open
sam-huang1223 wants to merge 1 commit into
sam-huang1223 wants to merge 1 commit into
Conversation
Add the optional PodGroupSpec.SafeToDisrupt field, ParseSafeToDisrupt, and the kai.scheduler/safe-to-disrupt annotation key. A PodGroup with safeToDisrupt false is not evicted for reasons other than fairness or priority, which today means consolidation; preempt and reclaim are unaffected. Unset means true. Needed by kai-scheduler/KAI-Scheduler#2284. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Sam Huang <sam@Sams-MacBook-Pro-2.local>
sam-huang1223
added a commit
to sam-huang1223/KAI-Scheduler
that referenced
this pull request
Oct 12, 2026
… kai-scheduler/api Review feedback: safeToConsolidate tied the field to one action. safeToDisrupt (annotation kai.scheduler/safe-to-disrupt) is whether the scheduler may evict a PodGroup for reasons other than fairness or priority; today that is consolidation, and preempt and reclaim are unaffected, as before. Main reads PodGroup types, parsers and annotation keys from github.com/kai-scheduler/api (kai-scheduler#1917), so the field, ParseSafeToDisrupt and the annotation key move to kai-scheduler/api#22. go.mod temporarily replaces the module with that PR's commit; it becomes a plain version bump once the api module releases. The in-tree pkg/apis copy keeps only the field, so that make manifests still renders it into the chart CRD until kai-scheduler#1928 switches the chart to the api module's CRDs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Sam Huang <19882250+sam-huang1223@users.noreply.github.com>
4 tasks done
sam-huang1223
added a commit
to sam-huang1223/KAI-Scheduler
that referenced
this pull request
Oct 16, 2026
Per CONTRIBUTING, the replace is local-only. This builds once kai-scheduler/api#22 is released and go.mod is bumped to that version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gshaibi
requested changes
Oct 20, 2026
| // restartPolicy Never, or bare pods) can set it to false. It does not affect preempt or reclaim. | ||
| // Defaults to true. | ||
| // +optional | ||
| SafeToDisrupt *bool `json:"safeToDisrupt,omitempty" protobuf:"varint,11,opt,name=safeToDisrupt"` |
Member
There was a problem hiding this comment.
Hi @sam-huang1223, we discussed this as a team and decided to start with an annotation only. If it gets wide adoption, we can later promote it to a PodGroup field.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds an optional
PodGroupSpec.SafeToDisrupt(*bool) and thekai.scheduler/safe-to-disruptannotation key, so a workload can opt out of evictions that are not driven by fairness or priority. Today that is the consolidation action, which evicts pods to repack nodes for a pending workload. A workload that does not survive a restart (for example replicas withrestartPolicy: Never, or bare pods) can set it tofalse. Preempt and reclaim are unaffected. Unset meanstrue, so existing PodGroups behave as before.PodGroupSpec.SafeToDisrupt(protobuf tag 11), with the regenerated deepcopy and CRD.ParseSafeToDisrupt, which the pod-grouper uses to read the annotation, as it doesParsePreemptionDelayandParseStalenessGracePeriod.SafeToDisruptAnnotationKey, next to the preemption-delay and staleness-grace-period keys.The pod-grouper and scheduler changes that use these are in kai-scheduler/KAI-Scheduler#2284. Following review there, the field is named
safeToDisruptrather thansafeToConsolidate, so it is not tied to one action. Following kai-scheduler/KAI-Scheduler#1928, the API part lands here first.Related Issues
Part of kai-scheduler/KAI-Scheduler#2283; needed by kai-scheduler/KAI-Scheduler#2284.
Checklist
TestParseSafeToDisruptmake changelogBreaking Changes
None. The field is optional and defaults to
true.Additional Notes
make generate manifests build test lintis clean. The only generated changes are the new field inzz_generated.deepcopy.goand inconfig/crd/scheduling.run.ai_podgroups.yaml.🤖 Generated with Claude Code