Documentation ¶
Index ¶
- Constants
- func NewBalancedAllocation(_ context.Context, baArgs runtime.Object, h framework.Handle, ...) (framework.Plugin, error)
- func NewFit(_ context.Context, plArgs runtime.Object, h framework.Handle, ...) (framework.Plugin, error)
- type BalancedAllocation
- func (ba *BalancedAllocation) Name() string
- func (ba *BalancedAllocation) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (ba *BalancedAllocation) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
- func (ba *BalancedAllocation) ScoreExtensions() framework.ScoreExtensions
- type Fit
- func (f *Fit) EventsToRegister(_ context.Context) ([]framework.ClusterEventWithHint, error)
- 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.PreFilterResult, *framework.Status)
- func (f *Fit) PreFilterExtensions() framework.PreFilterExtensions
- func (f *Fit) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (f *Fit) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
- func (f *Fit) ScoreExtensions() framework.ScoreExtensions
- type InsufficientResource
- type ResourceRequestsOptions
Constants ¶
const (
BalancedAllocationName = names.NodeResourcesBalancedAllocation
)
BalancedAllocationName is the name of the plugin used in the plugin registry and configurations.
const ( // Name is the name of the plugin used in the plugin registry and configurations. Name = names.NodeResourcesFit )
Variables ¶
This section is empty.
Functions ¶
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) PreScore ¶ added in v1.27.0
func (ba *BalancedAllocation) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*framework.NodeInfo) *framework.Status
PreScore calculates incoming pod's resource requests and writes them to the cycle state used.
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) EventsToRegister ¶ added in v1.21.0
EventsToRegister returns the possible events that may make a Pod failed by this plugin schedulable.
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) PreFilter ¶ added in v1.18.0
func (f *Fit) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod) (*framework.PreFilterResult, *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.
func (*Fit) PreScore ¶ added in v1.27.0
func (f *Fit) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*framework.NodeInfo) *framework.Status
PreScore calculates incoming pod's resource requests and writes them to the cycle state used.
func (*Fit) Score ¶ added in v1.22.0
func (f *Fit) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
Score invoked at the Score extension point.
func (*Fit) ScoreExtensions ¶ added in v1.22.0
func (f *Fit) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score 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 *framework.NodeInfo, opts ResourceRequestsOptions) []InsufficientResource
Fits checks if node have enough resources to host the pod.
type ResourceRequestsOptions ¶ added in v1.32.0
type ResourceRequestsOptions struct {
EnablePodLevelResources bool
}