Skip to content

fix(scheduler): apply PodGroup scheduling status with SSA - #2724

Draft
gaoyk19 wants to merge 1 commit into
kai-scheduler:mainfrom
gaoyk19:fix/podgroup-status-ssa
Draft

gaoyk19 wants to merge 1 commit into
kai-scheduler:mainfrom
gaoyk19:fix/podgroup-status-ssa

Conversation

@gaoyk19

@gaoyk19 gaoyk19 commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Description

Replace full PodGroup UpdateStatus calls with server-side apply so scheduler writes preserve other node pools' conditions and controller-owned resource statistics.

Each node pool uses a stable field manager. The writer migrates legacy ownership, checks the CRD merge schema, and uses version preconditions with bounded retries to reject stale verdicts while handling concurrent updates.

The change also preserves newer queued updates and merges only the current pool's status into scheduler snapshots.

Related Issues

Fixes #2612.

Checklist

  • Self-reviewed
  • Added/updated tests (if needed)
  • Updated documentation (if needed)
  • Added a changelog fragment via make changelog.

Breaking Changes

Older assigners that read the last list element as the latest condition are incompatible. Consumers must select the condition with the highest numeric TransitionID.

Upgrade consumers and the PodGroup CRD before enabling this writer, and stop old scheduler status writers during the transition. No legacy-write mode is provided.

Migration details are documented in docs/developer/designs/podgroup-status-ssa/README.md.

Additional Notes

Depends on kai-scheduler/api#36. Keep this PR as a draft until that change is released and go.mod is updated.

Validation passed:

  • Relevant unit and envtest suites, covering upgrades, migration, concurrent writers, state handoff, and stale inputs.
  • Targeted race tests.
  • Repository-wide go vet.
  • Local lint with zero issues.

make validate could not complete its Docker lint step because the local Docker daemon was unavailable.

Isolate scheduling condition ownership by node pool and migrate legacy status ownership without replacing unrelated controller fields. Fence stale verdicts with version checks and bounded conflict retries.

Preserve newer queued updates and merge only the current pool status into scheduler snapshots. Add envtest coverage for schema upgrades, legacy cleanup, concurrent writers, and scheduling state handoff.

Document the required CRD rollout and the incompatibility with older assigners that infer condition recency from list position.

Validation: relevant unit and envtest suites, targeted race tests, repository-wide go vet, and local lint passed. Docker-based make validate could not complete because the Docker daemon was unavailable.
Signed-off-by: gaoyk19 <gaoyk19@163.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write PodGroup scheduling status with server-side apply

1 participant