scheduler

package
v0.0.0-...-714e66c Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const SchedulerName = "OndemandSpotBalancer"

Variables

This section is empty.

Functions

func NewScheduler

func NewScheduler(_ runtime.Object, handle framework.Handle) (framework.Plugin, error)

NewScheduler initializes a new plugin and returns it.

Types

type OndemandSpotBalancer

type OndemandSpotBalancer struct {
	client.Client
	// contains filtered or unexported fields
}

NetworkOverhead : Filter and Score nodes based on Pod's AppGroup requirements: MaxNetworkCosts requirements among Pods with dependencies

func (*OndemandSpotBalancer) AddPod

func (*OndemandSpotBalancer) AddPod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *corev1.Pod, podToAdd *framework.PodInfo, nodeInfo *framework.NodeInfo) *framework.Status

func (*OndemandSpotBalancer) Filter

func (osb *OndemandSpotBalancer) Filter(ctx context.Context,
	cycleState *framework.CycleState,
	pod *corev1.Pod,
	nodeInfo *framework.NodeInfo) *framework.Status

Filter performs the following operations: 1. Get the % in ondemand/spot from PreFilterState 2. Get the node type (ondemand/spot) 2. Check if the pod can be added to the node. If ondemand/spot % is met, allow. otherwise fail

func (*OndemandSpotBalancer) Name

func (*OndemandSpotBalancer) Name() string

func (*OndemandSpotBalancer) NormalizeScore

func (osb *OndemandSpotBalancer) NormalizeScore(ctx context.Context,
	state *framework.CycleState,
	pod *corev1.Pod,
	scores framework.NodeScoreList) *framework.Status

NormalizeScore : normalize scores since lower scores correspond to lower priority

func (*OndemandSpotBalancer) PreFilter

PreFilter performs the following operations: 1. Get the owner 2. Get desired % of ondemand/spot from deployment annotation 3. Get the list of pods belonging to the app 4. Get the list of nodes running the pods 5. Calculate the current % in ondemand/spot 6. Calculate the % in ondemand/spot, after adding new po 7. Save desired % and calculated % to PreFilterState

func (*OndemandSpotBalancer) PreFilterExtensions

func (osb *OndemandSpotBalancer) PreFilterExtensions() framework.PreFilterExtensions

PreFilterExtensions is used for updating plugin state when a pod is added or removed (for preemption). This plugin is stateless, so these functions are not needed

func (*OndemandSpotBalancer) RemovePod

func (*OndemandSpotBalancer) RemovePod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *corev1.Pod, podToRemove *framework.PodInfo, nodeInfo *framework.NodeInfo) *framework.Status

func (*OndemandSpotBalancer) Score

func (osb *OndemandSpotBalancer) Score(ctx context.Context,
	cycleState *framework.CycleState,
	pod *corev1.Pod,
	nodeName string) (int64, *framework.Status)

Score performs the following operations: 1. Get the % in ondemand/spot from PreFilterState 2. Get the type of current node 3. Set the score for the node. score = calcalated % - desried %

func (*OndemandSpotBalancer) ScoreExtensions

func (osb *OndemandSpotBalancer) ScoreExtensions() framework.ScoreExtensions

ScoreExtensions : an interface for Score extended functionality

type PreFilterState

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

PreFilterState computed at PreFilter and used at Filter and Score.

Jump to

Keyboard shortcuts

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