Documentation ¶
Index ¶
- Constants
- func NewBalancedAllocation(_ *runtime.Unknown, h framework.FrameworkHandle) (framework.Plugin, error)
- func NewFit(plArgs *runtime.Unknown, _ framework.FrameworkHandle) (framework.Plugin, error)
- func NewLeastAllocated(_ *runtime.Unknown, h framework.FrameworkHandle) (framework.Plugin, error)
- func NewMostAllocated(_ *runtime.Unknown, h framework.FrameworkHandle) (framework.Plugin, error)
- func NewRequestedToCapacityRatio(plArgs *runtime.Unknown, handle framework.FrameworkHandle) (framework.Plugin, error)
- func NewResourceLimits(_ *runtime.Unknown, h framework.FrameworkHandle) (framework.Plugin, error)
- type BalancedAllocation
- type Fit
- func (f *Fit) Filter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (f *Fit) Name() string
- func (f *Fit) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod) *framework.Status
- func (f *Fit) PreFilterExtensions() framework.PreFilterExtensions
- type FitArgs
- type InsufficientResource
- type LeastAllocated
- type MostAllocated
- type RequestedToCapacityRatio
- type RequestedToCapacityRatioArgs
- type ResourceLimits
- func (rl *ResourceLimits) Name() string
- func (rl *ResourceLimits) PreScore(pCtx context.Context, cycleState *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (rl *ResourceLimits) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
- func (rl *ResourceLimits) ScoreExtensions() framework.ScoreExtensions
Constants ¶
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"
)
const (
// ResourceLimitsName is the name of the plugin used in the plugin registry and configurations.
ResourceLimitsName = "NodeResourceLimits"
)
Variables ¶
This section is empty.
Functions ¶
func NewBalancedAllocation ¶
func NewBalancedAllocation(_ *runtime.Unknown, h framework.FrameworkHandle) (framework.Plugin, error)
NewBalancedAllocation initializes a new plugin and returns it.
func NewLeastAllocated ¶
NewLeastAllocated initializes a new plugin and returns it.
func NewMostAllocated ¶
NewMostAllocated initializes a new plugin and returns it.
func NewRequestedToCapacityRatio ¶ added in v1.18.0
func NewRequestedToCapacityRatio(plArgs *runtime.Unknown, handle framework.FrameworkHandle) (framework.Plugin, error)
NewRequestedToCapacityRatio initializes a new plugin and returns it.
func NewResourceLimits ¶ added in v1.18.0
NewResourceLimits initializes a new plugin and returns it.
Types ¶
type BalancedAllocation ¶
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 (*BalancedAllocation) Name ¶
func (ba *BalancedAllocation) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*BalancedAllocation) Score ¶
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 (*BalancedAllocation) ScoreExtensions ¶
func (ba *BalancedAllocation) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.
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 *schedulernodeinfo.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) PreFilter ¶ added in v1.18.0
func (f *Fit) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod) *framework.Status
PreFilter invoked at the prefilter extension point.
func (*Fit) PreFilterExtensions ¶ added in v1.18.0
func (f *Fit) PreFilterExtensions() framework.PreFilterExtensions
PreFilterExtensions returns prefilter extensions, pod add and remove.
type FitArgs ¶ added in v1.18.0
type FitArgs struct { // IgnoredResources is the list of resources that NodeResources fit filter // should ignore. IgnoredResources []string `json:"ignoredResources,omitempty"` }
FitArgs holds the args that are used to configure the plugin.
type InsufficientResource ¶ added in v1.18.0
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 ¶ added in v1.18.0
func Fits(pod *v1.Pod, nodeInfo *schedulernodeinfo.NodeInfo, ignoredExtendedResources sets.String) []InsufficientResource
Fits checks if node have enough resources to host the pod.
type LeastAllocated ¶
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 (*LeastAllocated) Name ¶
func (la *LeastAllocated) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*LeastAllocated) Score ¶
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 (*LeastAllocated) ScoreExtensions ¶
func (la *LeastAllocated) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.
type MostAllocated ¶
type MostAllocated struct {
// contains filtered or unexported fields
}
MostAllocated is a score plugin that favors nodes with high allocation based on requested resources.
func (*MostAllocated) Name ¶
func (ma *MostAllocated) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*MostAllocated) Score ¶
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 (*MostAllocated) ScoreExtensions ¶
func (ma *MostAllocated) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.
type RequestedToCapacityRatio ¶ added in v1.18.0
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 (*RequestedToCapacityRatio) Name ¶ added in v1.18.0
func (pl *RequestedToCapacityRatio) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*RequestedToCapacityRatio) Score ¶ added in v1.18.0
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 (*RequestedToCapacityRatio) ScoreExtensions ¶ added in v1.18.0
func (pl *RequestedToCapacityRatio) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.
type RequestedToCapacityRatioArgs ¶ added in v1.18.0
type RequestedToCapacityRatioArgs struct {
config.RequestedToCapacityRatioArguments
}
RequestedToCapacityRatioArgs holds the args that are used to configure the plugin.
type ResourceLimits ¶ added in v1.18.0
type ResourceLimits struct {
// contains filtered or unexported fields
}
ResourceLimits is a score plugin that increases score of input node by 1 if the node satisfies input pod's resource limits
func (*ResourceLimits) Name ¶ added in v1.18.0
func (rl *ResourceLimits) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*ResourceLimits) PreScore ¶ added in v1.18.0
func (rl *ResourceLimits) PreScore( pCtx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*v1.Node, ) *framework.Status
PreScore builds and writes cycle state used by Score and NormalizeScore.
func (*ResourceLimits) Score ¶ added in v1.18.0
func (rl *ResourceLimits) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
Score invoked at the Score extension point. The "score" returned in this function is the matching number of pods on the `nodeName`. Currently works as follows: If a node does not publish its allocatable resources (cpu and memory both), the node score is not affected. If a pod does not specify its cpu and memory limits both, the node score is not affected. If one or both of cpu and memory limits of the pod are satisfied, the node is assigned a score of 1. Rationale of choosing the lowest score of 1 is that this is mainly selected to break ties between nodes that have same scores assigned by one of least and most requested priority functions.
func (*ResourceLimits) ScoreExtensions ¶ added in v1.18.0
func (rl *ResourceLimits) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.