Documentation ¶
Index ¶
- Constants
- func New(plArgs runtime.Object, h framework.FrameworkHandle) (framework.Plugin, error)
- func ValidateHardPodAffinityWeight(path *field.Path, w int32) error
- type InterPodAffinity
- func (pl *InterPodAffinity) AddPod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, ...) *framework.Status
- func (pl *InterPodAffinity) BuildArgs() interface{}
- func (pl *InterPodAffinity) Filter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (pl *InterPodAffinity) Name() string
- func (pl *InterPodAffinity) NormalizeScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (pl *InterPodAffinity) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod) *framework.Status
- func (pl *InterPodAffinity) PreScore(pCtx context.Context, cycleState *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (pl *InterPodAffinity) RemovePod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, ...) *framework.Status
- func (pl *InterPodAffinity) Score(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, ...) (int64, *framework.Status)
- func (pl *InterPodAffinity) ScoreExtensions() framework.ScoreExtensions
Constants ¶
const ( // ErrReasonExistingAntiAffinityRulesNotMatch is used for ExistingPodsAntiAffinityRulesNotMatch predicate error. ErrReasonExistingAntiAffinityRulesNotMatch = "node(s) didn't satisfy existing pods anti-affinity rules" // ErrReasonAffinityNotMatch is used for MatchInterPodAffinity predicate error. ErrReasonAffinityNotMatch = "node(s) didn't match pod affinity/anti-affinity" // ErrReasonAffinityRulesNotMatch is used for PodAffinityRulesNotMatch predicate error. ErrReasonAffinityRulesNotMatch = "node(s) didn't match pod affinity rules" // ErrReasonAntiAffinityRulesNotMatch is used for PodAntiAffinityRulesNotMatch predicate error. ErrReasonAntiAffinityRulesNotMatch = "node(s) didn't match pod anti-affinity rules" )
const ( // Name is the name of the plugin used in the plugin registry and configurations. Name = "InterPodAffinity" // DefaultHardPodAffinityWeight is the default HardPodAffinityWeight. DefaultHardPodAffinityWeight int32 = 1 // MinHardPodAffinityWeight is the minimum HardPodAffinityWeight. MinHardPodAffinityWeight int32 = 0 // MaxHardPodAffinityWeight is the maximum HardPodAffinityWeight. MaxHardPodAffinityWeight int32 = 100 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InterPodAffinity ¶
InterPodAffinity is a plugin that checks inter pod affinity
func (*InterPodAffinity) AddPod ¶
func (pl *InterPodAffinity) AddPod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, podToAdd *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status
AddPod from pre-computed data in cycleState.
func (*InterPodAffinity) BuildArgs ¶
func (pl *InterPodAffinity) BuildArgs() interface{}
BuildArgs returns the args that were used to build the plugin.
func (*InterPodAffinity) Filter ¶
func (pl *InterPodAffinity) Filter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status
Filter invoked at the filter extension point. It checks if a pod can be scheduled on the specified node with pod affinity/anti-affinity configuration.
func (*InterPodAffinity) Name ¶
func (pl *InterPodAffinity) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*InterPodAffinity) NormalizeScore ¶
func (pl *InterPodAffinity) NormalizeScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, scores framework.NodeScoreList) *framework.Status
NormalizeScore normalizes the score for each filteredNode. The basic rule is: the bigger the score(matching number of pods) is, the smaller the final normalized score will be.
func (*InterPodAffinity) PreFilter ¶
func (pl *InterPodAffinity) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod) *framework.Status
PreFilter invoked at the prefilter extension point.
func (*InterPodAffinity) PreScore ¶
func (pl *InterPodAffinity) PreScore( pCtx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*v1.Node, ) *framework.Status
PreScore builds and writes cycle state used by Score and NormalizeScore.
func (*InterPodAffinity) RemovePod ¶
func (pl *InterPodAffinity) RemovePod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, podToRemove *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status
RemovePod from pre-computed data in cycleState.
func (*InterPodAffinity) Score ¶
func (pl *InterPodAffinity) Score(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status)
Score invoked at the Score extension point. The "score" returned in this function is the matching number of pods on the `nodeName`, it is normalized later.
func (*InterPodAffinity) ScoreExtensions ¶
func (pl *InterPodAffinity) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions of the Score plugin.