Documentation ¶
Index ¶
- Constants
- func New(_ context.Context, plArgs runtime.Object, h framework.Handle) (framework.Plugin, error)
- type NodeAffinity
- func (pl *NodeAffinity) EventsToRegister(_ context.Context) ([]framework.ClusterEventWithHint, error)
- func (pl *NodeAffinity) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (pl *NodeAffinity) Name() string
- func (pl *NodeAffinity) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (pl *NodeAffinity) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod) (*framework.PreFilterResult, *framework.Status)
- func (pl *NodeAffinity) PreFilterExtensions() framework.PreFilterExtensions
- func (pl *NodeAffinity) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (pl *NodeAffinity) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
- func (pl *NodeAffinity) ScoreExtensions() framework.ScoreExtensions
Constants ¶
const ( // Name is the name of the plugin used in the plugin registry and configurations. Name = names.NodeAffinity // ErrReasonPod is the reason for Pod's node affinity/selector not matching. ErrReasonPod = "node(s) didn't match Pod's node affinity/selector" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NodeAffinity ¶
type NodeAffinity struct {
// contains filtered or unexported fields
}
NodeAffinity is a plugin that checks if a pod node selector matches the node label.
func (*NodeAffinity) EventsToRegister ¶ added in v1.22.0
func (pl *NodeAffinity) EventsToRegister(_ context.Context) ([]framework.ClusterEventWithHint, error)
EventsToRegister returns the possible events that may make a Pod failed by this plugin schedulable.
func (*NodeAffinity) Filter ¶
func (pl *NodeAffinity) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status
Filter checks if the Node matches the Pod .spec.affinity.nodeAffinity and the plugin's added affinity.
func (*NodeAffinity) Name ¶
func (pl *NodeAffinity) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*NodeAffinity) NormalizeScore ¶
func (pl *NodeAffinity) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *v1.Pod, scores framework.NodeScoreList) *framework.Status
NormalizeScore invoked after scoring all nodes.
func (*NodeAffinity) PreFilter ¶ added in v1.21.0
func (pl *NodeAffinity) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod) (*framework.PreFilterResult, *framework.Status)
PreFilter builds and writes cycle state used by Filter.
func (*NodeAffinity) PreFilterExtensions ¶ added in v1.21.0
func (pl *NodeAffinity) PreFilterExtensions() framework.PreFilterExtensions
PreFilterExtensions not necessary for this plugin as state doesn't depend on pod additions or deletions.
func (*NodeAffinity) PreScore ¶ added in v1.21.0
func (pl *NodeAffinity) PreScore(ctx 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 (*NodeAffinity) Score ¶
func (pl *NodeAffinity) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
Score returns the sum of the weights of the terms that match the Node. Terms came from the Pod .spec.affinity.nodeAffinity and from the plugin's default affinity.
func (*NodeAffinity) ScoreExtensions ¶
func (pl *NodeAffinity) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.