placementpolicy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is the plugin name
	Name = "placementpolicy"
)

Variables

This section is empty.

Functions

func New

func New(obj runtime.Object, handle framework.Handle) (framework.Plugin, error)

New initializes and returns a new PlacementPolicy plugin.

func NewStateData

func NewStateData(name string, pp *v1alpha1.PlacementPolicy) framework.StateData

Types

type Plugin

type Plugin struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Plugin is a plugin that schedules pods on nodes based on PlacementPolicy custom resource.

func (*Plugin) Filter

func (p *Plugin) Filter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeInfo *framework.NodeInfo) *framework.Status

Filter invoked at the filter extension point.

func (*Plugin) Name

func (p *Plugin) Name() string

Name returns name of the plugin. It is used in logs, etc.

func (*Plugin) NormalizeScore

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

NormalizeScore invoked after scoring all nodes.

func (*Plugin) PreFilter

func (p *Plugin) PreFilter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod) *framework.Status

PreFilter performs the following. 1. Whether there is a placement policy for the pod. 2. Whether the placement policy is Strict. 3. Determines the node preference for the pod: node with labels matching placement policy or other 4. Annotate the pod with the node preference and the placement policy.

func (*Plugin) PreFilterExtensions

func (p *Plugin) PreFilterExtensions() framework.PreFilterExtensions

PreFilterExtensions returns a PreFilterExtensions interface if the plugin implements one.

func (*Plugin) PreScore

func (p *Plugin) PreScore(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodes []*corev1.Node) *framework.Status

PreScore performs the following. 1. Whether there is a placement policy for the pod. 2. Whether the placement policy is BestEffort. 3. Determines the node preference for the pod: node with labels matching placement policy or other 4. Annotate the pod with the node preference and the placement policy.

func (*Plugin) Score

func (p *Plugin) Score(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeName string) (int64, *framework.Status)

Score invoked at the score extension point.

func (*Plugin) ScoreExtensions

func (p *Plugin) ScoreExtensions() framework.ScoreExtensions

ScoreExtensions of the Score plugin.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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