import "k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources"
balanced_allocation.go fit.go least_allocated.go most_allocated.go requested_to_capacity_ratio.go resource_allocation.go test_util.go
const BalancedAllocationName = "NodeResourcesBalancedAllocation"
BalancedAllocationName is the name of the plugin used in the plugin registry and configurations.
const ( // FitName is the name of the plugin used in the plugin registry and configurations. FitName = "NodeResourcesFit" )
const LeastAllocatedName = "NodeResourcesLeastAllocated"
LeastAllocatedName is the name of the plugin used in the plugin registry and configurations.
const MostAllocatedName = "NodeResourcesMostAllocated"
MostAllocatedName is the name of the plugin used in the plugin registry and configurations.
const ( // RequestedToCapacityRatioName is the name of this plugin. RequestedToCapacityRatioName = "RequestedToCapacityRatio" )
NewBalancedAllocation initializes a new plugin and returns it.
NewFit initializes a new plugin and returns it.
NewLeastAllocated initializes a new plugin and returns it.
NewMostAllocated initializes a new plugin and returns it.
func NewRequestedToCapacityRatio(plArgs runtime.Object, handle framework.Handle) (framework.Plugin, error)
NewRequestedToCapacityRatio initializes a new plugin and returns it.
type BalancedAllocation struct {
// contains filtered or unexported fields
}
BalancedAllocation is a score plugin that calculates the difference between the cpu and memory fraction of capacity, and prioritizes the host based on how close the two metrics are to each other.
func (ba *BalancedAllocation) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (ba *BalancedAllocation) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
Score invoked at the score extension point.
func (ba *BalancedAllocation) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.
type Fit struct {
// contains filtered or unexported fields
}
Fit is a plugin that checks if a node has sufficient resources.
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.
Name returns name of the plugin. It is used in logs, etc.
func (f *Fit) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod) *framework.Status
PreFilter invoked at the prefilter extension point.
func (f *Fit) PreFilterExtensions() framework.PreFilterExtensions
PreFilterExtensions returns prefilter extensions, pod add and remove.
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.
Fits checks if node have enough resources to host the pod.
type LeastAllocated struct {
// contains filtered or unexported fields
}
LeastAllocated is a score plugin that favors nodes with fewer allocation requested resources based on requested resources.
func (la *LeastAllocated) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (la *LeastAllocated) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
Score invoked at the score extension point.
func (la *LeastAllocated) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.
type MostAllocated struct {
// contains filtered or unexported fields
}
MostAllocated is a score plugin that favors nodes with high allocation based on requested resources.
func (ma *MostAllocated) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (ma *MostAllocated) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
Score invoked at the Score extension point.
func (ma *MostAllocated) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.
type RequestedToCapacityRatio struct {
// contains filtered or unexported fields
}
RequestedToCapacityRatio is a score plugin that allow users to apply bin packing on core resources like CPU, Memory as well as extended resources like accelerators.
func (pl *RequestedToCapacityRatio) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (pl *RequestedToCapacityRatio) Score(ctx context.Context, _ *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
Score invoked at the score extension point.
func (pl *RequestedToCapacityRatio) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.
Package noderesources imports 19 packages (graph) and is imported by 62 packages. Updated 2020-12-28. Refresh now. Tools for package owners.