Documentation ¶
Index ¶
- Constants
- func New(obj runtime.Object, handle framework.Handle) (framework.Plugin, error)
- func NewStateData(name string, pp *v1alpha1.PlacementPolicy) framework.StateData
- type Plugin
- func (p *Plugin) Filter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (p *Plugin) Name() string
- func (p *Plugin) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (p *Plugin) PreFilter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod) *framework.Status
- func (p *Plugin) PreFilterExtensions() framework.PreFilterExtensions
- func (p *Plugin) PreScore(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (p *Plugin) Score(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) (int64, *framework.Status)
- func (p *Plugin) ScoreExtensions() framework.ScoreExtensions
Constants ¶
const (
// Name is the plugin name
Name = "placementpolicy"
)
Variables ¶
This section is empty.
Functions ¶
func NewStateData ¶
func NewStateData(name string, pp *v1alpha1.PlacementPolicy) framework.StateData
Types ¶
type Plugin ¶
Plugin is a plugin that schedules pods on nodes based on PlacementPolicy custom resource.
func (*Plugin) Filter ¶
func (p *Plugin) Filter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeInfo *framework.NodeInfo) *framework.Status
Filter invoked at the filter extension point.
func (*Plugin) NormalizeScore ¶
func (p *Plugin) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, scores framework.NodeScoreList) *framework.Status
NormalizeScore invoked after scoring all nodes.
func (*Plugin) PreFilter ¶
func (p *Plugin) PreFilter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod) *framework.Status
PreFilter performs the following. 1. Whether there is a placement policy for the pod. 2. Whether the placement policy is Strict. 3. Determines the node preference for the pod: node with labels matching placement policy or other 4. Annotate the pod with the node preference and the placement policy.
func (*Plugin) PreFilterExtensions ¶
func (p *Plugin) PreFilterExtensions() framework.PreFilterExtensions
PreFilterExtensions returns a PreFilterExtensions interface if the plugin implements one.
func (*Plugin) PreScore ¶
func (p *Plugin) PreScore(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodes []*corev1.Node) *framework.Status
PreScore performs the following. 1. Whether there is a placement policy for the pod. 2. Whether the placement policy is BestEffort. 3. Determines the node preference for the pod: node with labels matching placement policy or other 4. Annotate the pod with the node preference and the placement policy.
func (*Plugin) Score ¶
func (p *Plugin) Score(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeName string) (int64, *framework.Status)
Score invoked at the score extension point.
func (*Plugin) ScoreExtensions ¶
func (p *Plugin) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.