Documentation ¶
Index ¶
- Constants
- func MakeDefaultErrorFunc(client clientset.Interface, schedulerCache godelcache.SchedulerCache) func(*framework.QueuedPodInfo, error)
- func NewBasePlugins() framework.PluginCollectionSet
- func ParseSwitchTypeForCNR(cnr *katalystv1alpha1.CustomNodeResource) framework.SwitchType
- func ParseSwitchTypeForNMNode(nmNode *nodev1alpha1.NMNode) framework.SwitchType
- func ParseSwitchTypeForNode(node *v1.Node) framework.SwitchType
- func ParseSwitchTypeForPod(pod *v1.Pod) framework.SwitchType
- type CtxKeyScheduleDataSetType
- type Option
- type ProcessFunc
- type ScheduleDataSet
- type ScheduleDataSetImpl
- func (s *ScheduleDataSetImpl) CanBeRecycle() bool
- func (s *ScheduleDataSetImpl) Close() bool
- func (s *ScheduleDataSetImpl) ClusterIndex() int
- func (s *ScheduleDataSetImpl) Ctx() context.Context
- func (s *ScheduleDataSetImpl) Run(parentCtx context.Context) bool
- func (s *ScheduleDataSetImpl) ScheduleFunc() func(context.Context)
- func (s *ScheduleDataSetImpl) SchedulingQueue() queue.SchedulingQueue
- func (s *ScheduleDataSetImpl) Snapshot() *cache.Snapshot
- func (s *ScheduleDataSetImpl) String() string
- func (s *ScheduleDataSetImpl) SubCluster() string
- func (s *ScheduleDataSetImpl) Type() framework.SwitchType
- type ScheduleSwitch
- type ScheduleSwitchImpl
- func (s *ScheduleSwitchImpl) Get(state framework.SwitchType) ScheduleDataSet
- func (s *ScheduleSwitchImpl) Process(state framework.SwitchType, f ProcessFunc)
- func (s *ScheduleSwitchImpl) Register(switchType framework.SwitchType, dataSet ScheduleDataSet)
- func (s *ScheduleSwitchImpl) Run(ctx context.Context)
- type Scheduler
- type StatusMaintainer
Constants ¶
const (
CtxKeyScheduleDataSet = CtxKeyScheduleDataSetType("ScheduleDataSet")
)
Variables ¶
This section is empty.
Functions ¶
func MakeDefaultErrorFunc ¶
func MakeDefaultErrorFunc(client clientset.Interface, schedulerCache godelcache.SchedulerCache) func(*framework.QueuedPodInfo, error)
MakeDefaultErrorFunc construct a function to handle pod scheduler error, logs error only in Godel Scheduler Compared to K8S scheduler, adding pod to unschedulableQ not works for all situation, then we should change this Error handling function
func NewBasePlugins ¶
func NewBasePlugins() framework.PluginCollectionSet
func ParseSwitchTypeForCNR ¶
func ParseSwitchTypeForCNR(cnr *katalystv1alpha1.CustomNodeResource) framework.SwitchType
func ParseSwitchTypeForNMNode ¶
func ParseSwitchTypeForNMNode(nmNode *nodev1alpha1.NMNode) framework.SwitchType
func ParseSwitchTypeForNode ¶
func ParseSwitchTypeForNode(node *v1.Node) framework.SwitchType
func ParseSwitchTypeForPod ¶
func ParseSwitchTypeForPod(pod *v1.Pod) framework.SwitchType
Types ¶
type CtxKeyScheduleDataSetType ¶
type CtxKeyScheduleDataSetType string
type Option ¶
type Option func(*schedulerOptions)
Option configures a Scheduler
func WithDefaultProfile ¶
func WithDefaultProfile(profile *config.GodelSchedulerProfile) Option
func WithRenewInterval ¶
WithRenewInterval sets renew interval for Scheduler in seconds, the default value is 30
func WithSubClusterKey ¶
func WithSubClusterProfiles ¶
func WithSubClusterProfiles(profiles []config.GodelSchedulerProfile) Option
type ProcessFunc ¶
type ProcessFunc func(ScheduleDataSet)
type ScheduleDataSet ¶
type ScheduleDataSet interface { ClusterIndex() int SubCluster() string Type() framework.SwitchType Ctx() context.Context Run(context.Context) bool Close() bool CanBeRecycle() bool Snapshot() *cache.Snapshot SchedulingQueue() queue.SchedulingQueue ScheduleFunc() func(context.Context) }
func NewScheduleDataSet ¶
func NewScheduleDataSet( idx int, subCluster string, switchType framework.SwitchType, snapshot *cache.Snapshot, schedulingQueue queue.SchedulingQueue, unitScheduler core.UnitScheduler, reconciler *reconciler.FailedTaskReconciler, debugger *cachedebugger.CacheDebugger, ) ScheduleDataSet
type ScheduleDataSetImpl ¶
type ScheduleDataSetImpl struct {
// contains filtered or unexported fields
}
func (*ScheduleDataSetImpl) CanBeRecycle ¶
func (s *ScheduleDataSetImpl) CanBeRecycle() bool
TODO: revisit this rule.
func (*ScheduleDataSetImpl) Close ¶
func (s *ScheduleDataSetImpl) Close() bool
func (*ScheduleDataSetImpl) ClusterIndex ¶
func (s *ScheduleDataSetImpl) ClusterIndex() int
func (*ScheduleDataSetImpl) Ctx ¶
func (s *ScheduleDataSetImpl) Ctx() context.Context
func (*ScheduleDataSetImpl) ScheduleFunc ¶
func (s *ScheduleDataSetImpl) ScheduleFunc() func(context.Context)
func (*ScheduleDataSetImpl) SchedulingQueue ¶
func (s *ScheduleDataSetImpl) SchedulingQueue() queue.SchedulingQueue
func (*ScheduleDataSetImpl) Snapshot ¶
func (s *ScheduleDataSetImpl) Snapshot() *cache.Snapshot
func (*ScheduleDataSetImpl) String ¶
func (s *ScheduleDataSetImpl) String() string
func (*ScheduleDataSetImpl) SubCluster ¶
func (s *ScheduleDataSetImpl) SubCluster() string
func (*ScheduleDataSetImpl) Type ¶
func (s *ScheduleDataSetImpl) Type() framework.SwitchType
type ScheduleSwitch ¶
type ScheduleSwitch interface { Run(context.Context) Get(framework.SwitchType) ScheduleDataSet Register(switchType framework.SwitchType, dataSet ScheduleDataSet) Process(framework.SwitchType, ProcessFunc) }
func NewScheduleSwitch ¶
func NewScheduleSwitch() ScheduleSwitch
type ScheduleSwitchImpl ¶
type ScheduleSwitchImpl struct {
// contains filtered or unexported fields
}
func (*ScheduleSwitchImpl) Get ¶
func (s *ScheduleSwitchImpl) Get(state framework.SwitchType) ScheduleDataSet
func (*ScheduleSwitchImpl) Process ¶
func (s *ScheduleSwitchImpl) Process(state framework.SwitchType, f ProcessFunc)
func (*ScheduleSwitchImpl) Register ¶
func (s *ScheduleSwitchImpl) Register(switchType framework.SwitchType, dataSet ScheduleDataSet)
func (*ScheduleSwitchImpl) Run ¶
func (s *ScheduleSwitchImpl) Run(ctx context.Context)
type Scheduler ¶
type Scheduler struct { // Name identifies the Godel Scheduler Name string // SchedulerName here is the higher level scheduler name, which is used to select pods // that godel schedulers should be responsible for and filter out irrelevant pods. SchedulerName *string // Close this to shut down the scheduler. StopEverything <-chan struct{} ScheduleSwitch ScheduleSwitch // contains filtered or unexported fields }
Scheduler watches for new unscheduled pods. It attempts to find nodes that they fit on and writes bindings back to the api server. Scheduler is the wrapper that watches for all pod and node event, the actual scheduling process is handled by schedule framework.
func New ¶
func New( godelSchedulerName string, schedulerName *string, client clientset.Interface, crdClient godelclient.Interface, informerFactory informers.SharedInformerFactory, crdInformerFactory crdinformers.SharedInformerFactory, katalystCrdInformerFactory katalystinformers.SharedInformerFactory, stopCh <-chan struct{}, recorder events.EventRecorder, reservationTTL time.Duration, opts ...Option) (*Scheduler, error, )
New returns a Scheduler
type StatusMaintainer ¶
type StatusMaintainer interface {
Run(stopCh <-chan struct{})
}
StatusMaintainer manages creating and renewing the status for this Scheduler
func NewSchedulerStatusMaintainer ¶
func NewSchedulerStatusMaintainer(clock clock.Clock, client godelclient.Interface, schedulerName string, renewIntervalSeconds int64) StatusMaintainer
NewSchedulerStatusMaintainer constructs and returns a maintainer