Documentation ¶
Index ¶
- Constants
- Variables
- func New(ctx context.Context, arg runtime.Object, h framework.Handle) (framework.Plugin, error)
- type NodeNumber
- func (pl *NodeNumber) EventsToRegister() []framework.ClusterEvent
- func (pl *NodeNumber) Name() string
- func (pl *NodeNumber) PreScore(ctx context.Context, state *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (pl *NodeNumber) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
- func (pl *NodeNumber) ScoreExtensions() framework.ScoreExtensions
- type NodeNumberArgs
Constants ¶
View Source
const (
// Name is the name of the plugin used in the plugin registry and configurations.
Name = "NodeNumber"
)
Variables ¶
View Source
var ErrNotExpectedPreScoreState = errors.New("unexpected pre score state")
Functions ¶
Types ¶
type NodeNumber ¶
type NodeNumber struct {
// contains filtered or unexported fields
}
NodeNumber is an example plugin that favors nodes that have the number suffix which is the same as the number suffix of the pod name. But if a reverse option is true, it favors nodes that have the number suffix which **isn't** the same as the number suffix of pod name.
For example: With reverse option false, when schedule a pod named Pod1, a Node named Node1 gets a lower score than a node named Node9.
NOTE: this plugin only handle single digit numbers only.
func (*NodeNumber) EventsToRegister ¶
func (pl *NodeNumber) EventsToRegister() []framework.ClusterEvent
func (*NodeNumber) Name ¶
func (pl *NodeNumber) Name() string
Name returns the name of the plugin. It is used in logs, etc.
func (*NodeNumber) Score ¶
func (pl *NodeNumber) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
Score invoked at the score extension point.
func (*NodeNumber) ScoreExtensions ¶
func (pl *NodeNumber) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.
type NodeNumberArgs ¶
NodeNumberArgs is arguments for node number plugin.
Click to show internal directories.
Click to hide internal directories.