scheduler

package
v1.60.4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace = "d8-upmeter"
)

Variables

View Source
var (
	// ErrSkip is the legal abortion of scheduling
	ErrSkip = fmt.Errorf("scheduling skipped")
)

Functions

This section is empty.

Types

type Cleaner

type Cleaner interface {
	Clean(string, *XState, *XState)
}

func NewCleaner

func NewCleaner(patcher *object_patch.PatchCollector, logger *logrus.Entry, pods []snapshot.Pod) Cleaner

type Deleter

type Deleter interface {
	Delete(string)
}

type IndexSelector

type IndexSelector interface {
	Select(State) (string, error)
}

type IndexSelectorPipe

type IndexSelectorPipe []IndexSelector

IndexSelectorPipe is the sequential wrapper for other sts selectors. The result is returned from the first successful selection or abortion error. Selection is ignored on next error.

func NewStatefulSetSelector

func NewStatefulSetSelector(
	nodes []snapshot.Node,
	storageClass string,
	pvcs []snapshot.PvcTermination,
	pods []snapshot.Pod,
	disruptionAllowed bool,
) IndexSelectorPipe

NewStatefulSetSelector creates statefulset choosing pipeline. The result returns ffrom the first successful selection. If no selection occurs, the pipeline returns ErrSkip.

func (IndexSelectorPipe) Select

func (s IndexSelectorPipe) Select(state State) (string, error)

type NodeFilter

type NodeFilter interface {
	Filter([]snapshot.Node, string) []snapshot.Node
}

type NodeFilterPipe

type NodeFilterPipe []NodeFilter

NodeFilterPipe is the sequential wrapper for other node filters. A result of each filter is passed to the next one. The filters do not share knowledge about each other. Filters are responsible to handle empty input their own way.

func NewNodeSelector

func NewNodeSelector(state State) NodeFilterPipe

NewNodeSelector crates the node fuiltering pipeline. The resulting node list is the result of all filters in the sequence from top to bottom.

func (NodeFilterPipe) Filter

func (pipe NodeFilterPipe) Filter(nodes []snapshot.Node, x string) []snapshot.Node

type Scheduler

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

func New

func New(indexSelector IndexSelector, nodeFilter NodeFilter, cleaner Cleaner, image, storageClass string) *Scheduler

func (*Scheduler) Schedule

func (s *Scheduler) Schedule(state State, nodes []snapshot.Node) (string, *XState, error)

type State

type State map[string]*XState

State is the internal state for smoke-mini

func (State) Empty

func (s State) Empty() bool

func (State) Populate

func (s State) Populate(statefulsets []snapshot.StatefulSet)

Populate fills the state with actual values. It is used only on the first run, when the state is empty. In all other cases the state is the source of truth.

type XState

type XState struct {
	Image        string `json:"image,omitempty"`
	Node         string `json:"node,omitempty"`
	Zone         string `json:"zone,omitempty"`
	StorageClass string `json:"effectiveStorageClass,omitempty"`
}

XState is the state of a single StatefulSet

Jump to

Keyboard shortcuts

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