statefulset

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "StatefulSetScheduler"

Name of the plugin used in the plugin registry and configurations.

Variables

This section is empty.

Functions

func NewSTSScheduler

func NewSTSScheduler(h framework.Handle, l Labels) (framework.Plugin, error)

NewSTSScheduler initializes and returns a new STSScheduler plugin.

Types

type Labels

type Labels struct {
	Pod  []string `envconfig:"pod" required:"true" desc:"Labels for Pod to be considered by the StatefulSetScheduler (any of the list)"` //nolint:lll
	Node string   `envconfig:"node" required:"true" desc:"Label to match for a Node to be considered suitable for scheduling a Pod"`     //nolint:lll
}

Labels holds the labels configuration for the STSScheduler.

type STSScheduler

type STSScheduler struct {
	Handle framework.Handle
	Labels
}

STSScheduler is a plugin that implements sorting based on the pod index and node's label match.

func (*STSScheduler) Filter

func (s *STSScheduler) Filter(
	ctx context.Context,
	state *framework.CycleState,
	pod *v1.Pod,
	nodeInfo *framework.NodeInfo,
) *framework.Status

Filter is invoked at the filter extension point to check if a node satisfies the scheduling requirements imposed by the STSScheduler plugin.

func (*STSScheduler) Name

func (s *STSScheduler) Name() string

Name returns name of the plugin.

func (*STSScheduler) PreFilter

PreFilter is invoked at the prefilter extension point to check if a pod can be scheduled based on the specific requirements such as labels and the type of workload it belongs to.

func (*STSScheduler) PreFilterExtensions

func (s *STSScheduler) PreFilterExtensions() framework.PreFilterExtensions

PreFilterExtensions returns nil as the STSScheduler does not have a PreFilterExtensions.

Jump to

Keyboard shortcuts

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