statefulset

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 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)

Types

type Autoscaler

type Autoscaler interface {
	// Start runs the autoscaler until cancelled.
	Start(ctx context.Context)

	// Autoscale is used to immediately trigger the autoscaler.
	Autoscale(ctx context.Context)
}

type Config added in v0.35.6

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

	ScaleCacheConfig scheduler.ScaleCacheConfig `json:"scaleCacheConfig"`
	// 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:"-"`
	// contains filtered or unexported fields
}

type GetReserved added in v0.38.2

type GetReserved func() map[types.NamespacedName]map[string]int32

type Pending added in v0.38.2

type Pending map[types.NamespacedName]int32

func (Pending) Total added in v0.38.2

func (p Pending) Total() int32

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) Reserved added in v0.38.2

func (s *StatefulSetScheduler) Reserved() map[types.NamespacedName]map[string]int32

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