statefulset

package
v0.38.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 39 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v0.35.6

func New(ctx context.Context, cfg *Config) (scheduler.Scheduler, error)

func NewScheduler

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. Deprecated: Use New

Types

type Autoscaler

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)
}

type Config added in v0.35.6

type Config struct {
	StatefulSetNamespace string `json:"statefulSetNamespace"`
	StatefulSetName      string `json:"statefulSetName"`

	// PodCapacity max capacity for each StatefulSet's pod.
	PodCapacity int32 `json:"podCapacity"`
	// Autoscaler refresh period
	RefreshPeriod time.Duration `json:"refreshPeriod"`

	SchedulerPolicy scheduler.SchedulerPolicyType `json:"schedulerPolicy"`
	SchedPolicy     *scheduler.SchedulerPolicy    `json:"schedPolicy"`
	DeschedPolicy   *scheduler.SchedulerPolicy    `json:"deschedPolicy"`

	Evictor scheduler.Evictor `json:"-"`

	VPodLister scheduler.VPodLister     `json:"-"`
	NodeLister corev1listers.NodeLister `json:"-"`
}

type StatefulSetScheduler

type StatefulSetScheduler struct {
	// contains filtered or unexported fields
}

StatefulSetScheduler is a scheduler placing VPod into statefulset-managed set of pods

func (*StatefulSetScheduler) Demote added in v0.37.0

func (s *StatefulSetScheduler) Demote(b reconciler.Bucket)

Demote implements reconciler.LeaderAware.

func (*StatefulSetScheduler) HasScorePlugins

func (s *StatefulSetScheduler) HasScorePlugins(state *st.State, policy *scheduler.SchedulerPolicy) bool

HasScorePlugins returns true if at least one score plugin is defined.

func (*StatefulSetScheduler) Promote added in v0.37.0

Promote implements reconciler.LeaderAware.

func (*StatefulSetScheduler) RunFilterPlugins

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL