noderesources

package
v0.0.0-...-d4c82a0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FitName is the name of the plugin used in the plugin registry and configurations.
	FitName = "NodeResourcesFit"
)

Variables

This section is empty.

Functions

func NewFit

NewFit initializes a new plugin and returns it.

Types

type Fit

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

Fit is a plugin that checks if a node has sufficient resources.

func (*Fit) Filter

func (f *Fit) Filter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status

Filter invoked at the filter extension point. Checks if a node has sufficient resources, such as cpu, memory, gpu, opaque int resources etc to run a pod. It returns a list of insufficient resources, if empty, then the node has all the resources requested by the pod.

func (*Fit) Name

func (f *Fit) Name() string

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

func (*Fit) PreFilter

func (f *Fit) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod) *framework.Status

PreFilter invoked at the prefilter extension point.

type InsufficientResource

type InsufficientResource struct {
	ResourceName v1.ResourceName
	// We explicitly have a parameter for reason to avoid formatting a message on the fly
	// for common resources, which is expensive for cluster autoscaler simulations.
	Reason    string
	Requested int64
	Used      int64
	Capacity  int64
}

InsufficientResource describes what kind of resource limit is hit and caused the pod to not fit the node.

func Fits

func Fits(pod *v1.Pod, nodeInfo *framework.NodeInfo, ignoredExtendedResources sets.String) []InsufficientResource

Fits checks if node have enough resources to host the pod.

Jump to

Keyboard shortcuts

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