dynamic

package
v0.0.0-...-c2c0533 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MinTimestampStrLength defines the min length of timestamp string.
	MinTimestampStrLength = 5
	// NodeHotValue is the key of hot value annotation.
	NodeHotValue = "node_hot_value"
	// DefautlHotVauleActivePeriod defines the validity period of nodes' hotvalue.
	DefautlHotVauleActivePeriod = 5 * time.Minute
	// ExtraActivePeriod gives extra active time to the annotation.
	ExtraActivePeriod = 5 * time.Minute
)
View Source
const (
	// Name is the name of the plugin used in the plugin registry and configurations.
	Name = "Dynamic"
)

Variables

This section is empty.

Functions

func LoadPolicyFromFile

func LoadPolicyFromFile(file string) (*policy.DynamicSchedulerPolicy, error)

func NewDynamicScheduler

func NewDynamicScheduler(plArgs runtime.Object, h framework.Handle) (framework.Plugin, error)

NewDynamicScheduler returns a Crane Scheduler object.

Types

type DynamicScheduler

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

Dynamic-scheduler is a real load-aware scheduler plugin.

func (*DynamicScheduler) Filter

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

Filter invoked at the filter extension point. checkes if the real load of one node is too high. It returns a list of failure reasons if the node is overload.

func (*DynamicScheduler) Name

func (ds *DynamicScheduler) Name() string

Name returns name of the plugin.

func (*DynamicScheduler) Score

func (ds *DynamicScheduler) Score(ctx context.Context, state *framework.CycleState, p *v1.Pod, nodeName string) (int64, *framework.Status)

Score invoked at the Score extension point. It gets metric data from node annotation, and favors nodes with the least real resource usage.

func (*DynamicScheduler) ScoreExtensions

func (ds *DynamicScheduler) ScoreExtensions() framework.ScoreExtensions

Jump to

Keyboard shortcuts

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