Documentation ¶
Index ¶
- func NewScheduler(ctx context.Context, namespace, name string, lister scheduler.VPodLister, ...) scheduler.Scheduler
- func NewStatefulSetScheduler(ctx context.Context, namespace, name string, lister scheduler.VPodLister, ...) scheduler.Scheduler
- type Autoscaler
- type StatefulSetScheduler
- func (s *StatefulSetScheduler) HasScorePlugins(state *st.State, policy *scheduler.SchedulerPolicy) bool
- func (s *StatefulSetScheduler) RunFilterPlugins(ctx context.Context, states *st.State, vpod scheduler.VPod, podID int32, ...) st.PluginToStatus
- func (s *StatefulSetScheduler) RunScorePlugins(ctx context.Context, states *st.State, vpod scheduler.VPod, ...) (st.PluginToPodScores, *st.Status)
- func (s *StatefulSetScheduler) Schedule(vpod scheduler.VPod) ([]duckv1alpha1.Placement, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewScheduler ¶ added in v0.22.0
func NewScheduler(ctx context.Context, namespace, name string, lister scheduler.VPodLister, refreshPeriod time.Duration, capacity int32, schedulerPolicy scheduler.SchedulerPolicyType, nodeLister corev1listers.NodeLister, evictor scheduler.Evictor, schedPolicy *scheduler.SchedulerPolicy, deschedPolicy *scheduler.SchedulerPolicy) scheduler.Scheduler
NewScheduler creates a new scheduler with pod autoscaling enabled.
func NewStatefulSetScheduler ¶
func NewStatefulSetScheduler(ctx context.Context, namespace, name string, lister scheduler.VPodLister, stateAccessor st.StateAccessor, autoscaler Autoscaler, podlister corev1listers.PodNamespaceLister) scheduler.Scheduler
Types ¶
type Autoscaler ¶ added in v0.22.0
type Autoscaler interface { // Start runs the autoscaler until cancelled. Start(ctx context.Context) // Autoscale is used to immediately trigger the autoscaler with the hint // that pending number of vreplicas couldn't be scheduled. Autoscale(ctx context.Context, attemptScaleDown bool, pending int32) }
func NewAutoscaler ¶ added in v0.22.0
func NewAutoscaler(ctx context.Context, namespace, name string, lister scheduler.VPodLister, stateAccessor st.StateAccessor, evictor scheduler.Evictor, refreshPeriod time.Duration, capacity int32) Autoscaler
type StatefulSetScheduler ¶
type StatefulSetScheduler struct {
// contains filtered or unexported fields
}
StatefulSetScheduler is a scheduler placing VPod into statefulset-managed set of pods
func (*StatefulSetScheduler) HasScorePlugins ¶ added in v0.26.0
func (s *StatefulSetScheduler) HasScorePlugins(state *st.State, policy *scheduler.SchedulerPolicy) bool
HasScorePlugins returns true if at least one score plugin is defined.
func (*StatefulSetScheduler) RunFilterPlugins ¶ added in v0.26.0
func (s *StatefulSetScheduler) RunFilterPlugins(ctx context.Context, states *st.State, vpod scheduler.VPod, podID int32, policy *scheduler.SchedulerPolicy) st.PluginToStatus
RunFilterPlugins runs the set of configured Filter plugins for a vrep on the given pod. If any of these plugins doesn't return "Success", the pod is not suitable for placing the vrep. Meanwhile, the failure message and status are set for the given pod.
func (*StatefulSetScheduler) RunScorePlugins ¶ added in v0.26.0
func (s *StatefulSetScheduler) RunScorePlugins(ctx context.Context, states *st.State, vpod scheduler.VPod, feasiblePods []int32, policy *scheduler.SchedulerPolicy) (st.PluginToPodScores, *st.Status)
RunScorePlugins runs the set of configured scoring plugins. It returns a list that stores for each scoring plugin name the corresponding PodScoreList(s). It also returns *Status, which is set to non-success if any of the plugins returns a non-success status.
func (*StatefulSetScheduler) Schedule ¶
func (s *StatefulSetScheduler) Schedule(vpod scheduler.VPod) ([]duckv1alpha1.Placement, error)