Documentation ¶
Index ¶
- Constants
- func MakeNode(node string, milliCPU, memory int64) *v1.Node
- func MakeNodeWithExtendedResource(node string, milliCPU, memory int64, extendedResource map[string]int64) *v1.Node
- func MakeResourceNode(node string, usage ...framework.Resource) *v1.Node
- func NewAdaptiveCpuToMemRatio(_ runtime.Object, h framework.SchedulerFrameworkHandle) (framework.Plugin, error)
- func NewBalancedAllocation(baArgs runtime.Object, h framework.SchedulerFrameworkHandle) (framework.Plugin, error)
- func NewFit(plArgs runtime.Object, _ framework.SchedulerFrameworkHandle) (framework.Plugin, error)
- func NewLeastAllocated(laArgs runtime.Object, h framework.SchedulerFrameworkHandle) (framework.Plugin, error)
- func NewMostAllocated(maArgs runtime.Object, h framework.SchedulerFrameworkHandle) (framework.Plugin, error)
- func NewNodeResourcesAffinity(atArgs runtime.Object, h framework.SchedulerFrameworkHandle) (framework.Plugin, error)
- func NewRequestedToCapacityRatio(plArgs runtime.Object, handle framework.SchedulerFrameworkHandle) (framework.Plugin, error)
- type AdaptiveCpuToMemRatio
- type BalancedAllocation
- type Fit
- func (f *Fit) Filter(_ context.Context, cycleState *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (f *Fit) Name() string
- func (f *Fit) PreFilter(_ context.Context, cycleState *framework.CycleState, pod *v1.Pod) *framework.Status
- func (f *Fit) PreFilterExtensions() framework.PreFilterExtensions
- type LeastAllocated
- type MostAllocated
- type NodeResourcesAffinity
- func (a *NodeResourcesAffinity) Name() string
- func (a *NodeResourcesAffinity) NormalizeScore(ctx context.Context, state *framework.CycleState, p *v1.Pod, ...) *framework.Status
- func (a *NodeResourcesAffinity) PreScore(_ context.Context, cycleState *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (a *NodeResourcesAffinity) Score(_ context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
- func (a *NodeResourcesAffinity) ScoreExtensions() framework.ScoreExtensions
- type RequestedToCapacityRatio
Constants ¶
const ( // NodeResourcesAffinityName is the name of the plugin used in the plugin registry and configurations. NodeResourcesAffinityName = "NodeResourcesAffinity" NodeResourcesAffinityPreScoreStateKey = "PreScore" + NodeResourcesAffinityName )
const AdaptiveCpuToMemRatioName = "AdaptiveCpuToMemRatio"
AdaptiveCpuToMemRatioName is the name of the plugin used in the plugin registry and configurations.
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"
)
Variables ¶
This section is empty.
Functions ¶
func NewAdaptiveCpuToMemRatio ¶
func NewAdaptiveCpuToMemRatio(_ runtime.Object, h framework.SchedulerFrameworkHandle) (framework.Plugin, error)
NewAdaptiveCpuToMemRatio initializes a new plugin and returns it.
func NewBalancedAllocation ¶
func NewBalancedAllocation(baArgs runtime.Object, h framework.SchedulerFrameworkHandle) (framework.Plugin, error)
NewBalancedAllocation initializes a new plugin and returns it.
func NewLeastAllocated ¶
func NewLeastAllocated(laArgs runtime.Object, h framework.SchedulerFrameworkHandle) (framework.Plugin, error)
NewLeastAllocated initializes a new plugin and returns it.
func NewMostAllocated ¶
func NewMostAllocated(maArgs runtime.Object, h framework.SchedulerFrameworkHandle) (framework.Plugin, error)
NewMostAllocated initializes a new plugin and returns it.
func NewNodeResourcesAffinity ¶
func NewNodeResourcesAffinity(atArgs runtime.Object, h framework.SchedulerFrameworkHandle) (framework.Plugin, error)
NewNodeResourcesAffinity initializes a new plugin and returns it.
func NewRequestedToCapacityRatio ¶
func NewRequestedToCapacityRatio(plArgs runtime.Object, handle framework.SchedulerFrameworkHandle) (framework.Plugin, error)
NewRequestedToCapacityRatio initializes a new plugin and returns it.
Types ¶
type AdaptiveCpuToMemRatio ¶
type AdaptiveCpuToMemRatio struct {
// contains filtered or unexported fields
}
func (*AdaptiveCpuToMemRatio) Name ¶
func (pl *AdaptiveCpuToMemRatio) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*AdaptiveCpuToMemRatio) Score ¶
func (pl *AdaptiveCpuToMemRatio) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
Score invoked at the score extension point.
func (*AdaptiveCpuToMemRatio) ScoreExtensions ¶
func (pl *AdaptiveCpuToMemRatio) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.
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(_ 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 ¶
func (f *Fit) PreFilter(_ context.Context, cycleState *framework.CycleState, pod *v1.Pod) *framework.Status
PreFilter invoked at the prefilter extension point.
func (*Fit) PreFilterExtensions ¶
func (f *Fit) PreFilterExtensions() framework.PreFilterExtensions
PreFilterExtensions returns prefilter extensions, pod add and remove.
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 NodeResourcesAffinity ¶
type NodeResourcesAffinity struct {
// contains filtered or unexported fields
}
NodeResourcesAffinity is a score plugin that favors nodes affinity with the resource request of pod get high score, vice versa.
func (*NodeResourcesAffinity) Name ¶
func (a *NodeResourcesAffinity) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*NodeResourcesAffinity) NormalizeScore ¶
func (a *NodeResourcesAffinity) NormalizeScore(ctx context.Context, state *framework.CycleState, p *v1.Pod, scores framework.NodeScoreList) *framework.Status
func (*NodeResourcesAffinity) PreScore ¶
func (a *NodeResourcesAffinity) PreScore(_ context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []framework.NodeInfo) *framework.Status
PreScore builds and writes cycle state used by Score and NormalizeScore.
func (*NodeResourcesAffinity) Score ¶
func (a *NodeResourcesAffinity) Score(_ context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
Score invoked at the score extension point.
func (*NodeResourcesAffinity) ScoreExtensions ¶
func (a *NodeResourcesAffinity) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.
type RequestedToCapacityRatio ¶
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 ¶
func (pl *RequestedToCapacityRatio) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*RequestedToCapacityRatio) Score ¶
func (pl *RequestedToCapacityRatio) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
Score invoked at the score extension point.
func (*RequestedToCapacityRatio) ScoreExtensions ¶
func (pl *RequestedToCapacityRatio) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.