Skip to content

Conversation

@AdheipSingh
Copy link

@AdheipSingh AdheipSingh commented Jan 16, 2026

Description

Added actions field to SchedulingShard CRD allowing users to configure
which scheduler actions run.

Changes:

  • pkg/apis/kai/v1/schedulingshard_types.go - Added Actions []string field
  • pkg/operator/operands/scheduler/resources_for_shard.go - Use custom
    actions if provided, otherwise use defaults
  • deployments/kai-scheduler/values.yaml - Added scheduler.actions config
    option
  • deployments/kai-scheduler/templates/default-shard.yaml - Pass actions to
    SchedulingShard

Usage:
scheduler:
actions: ["allocate", "reclaim", "preempt"] # excludes consolidation and
stalegangeviction

Default behavior unchanged - if actions is empty, uses: allocate,
consolidation, reclaim, preempt, stalegangeviction

Related Issues

Fixes #207

Checklist

Note: Ensure your PR title follows the Conventional Commits format (e.g., feat(scheduler): add new feature)

  • Self-reviewed
  • Added/updated tests (if needed)
  • Updated documentation (if needed)

Breaking Changes

Additional Notes

Screenshot 2026-01-17 at 2 57 55 AM

cc @enoodle

@enoodle
Copy link
Collaborator

enoodle commented Jan 19, 2026

Hi @AdheipSingh

We want to implement a more whole solution following this design: #833
cc @gshaibi

Comment on lines +134 to 144
if len(shard.Spec.Actions) > 0 {
// Use custom actions from shard spec
actions = shard.Spec.Actions
} else {
// Default actions
actions = []string{string(framework.Allocate)}
if placementArguments[gpuResource] != spreadStrategy && placementArguments[cpuResource] != spreadStrategy {
actions = append(actions, string(framework.Consolidation))
}
actions = append(actions, string(framework.Reclaim), string(framework.Preempt), string(framework.StaleGangEviction))
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Our convention is to set the defaults on the type (SetDefaultsWhereNeeded) and then we don't need them here.
Also please try to avoid obvious comments - they waste tokens.

@AdheipSingh
Copy link
Author

Hi @enoodle

Thanks for the update and pointing me to the PR i was not aware. I'll read over and then get back to you.
Regarding this PR, do you want me to close it ?

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.

Making field configurable in configmap actions

2 participants