mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Merge pull request #100020 from pravarag/interpodaffinity-schedule-plugin
implement EnqueueExtensions in interPodAffinity
This commit is contained in:
commit
2159f967b4
@ -39,6 +39,7 @@ var _ framework.PreFilterPlugin = &InterPodAffinity{}
|
|||||||
var _ framework.FilterPlugin = &InterPodAffinity{}
|
var _ framework.FilterPlugin = &InterPodAffinity{}
|
||||||
var _ framework.PreScorePlugin = &InterPodAffinity{}
|
var _ framework.PreScorePlugin = &InterPodAffinity{}
|
||||||
var _ framework.ScorePlugin = &InterPodAffinity{}
|
var _ framework.ScorePlugin = &InterPodAffinity{}
|
||||||
|
var _ framework.EnqueueExtensions = &InterPodAffinity{}
|
||||||
|
|
||||||
// InterPodAffinity is a plugin that checks inter pod affinity
|
// InterPodAffinity is a plugin that checks inter pod affinity
|
||||||
type InterPodAffinity struct {
|
type InterPodAffinity struct {
|
||||||
@ -54,6 +55,22 @@ func (pl *InterPodAffinity) Name() string {
|
|||||||
return Name
|
return Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EventsToRegister returns the possible events that may make a failed Pod
|
||||||
|
// schedulable
|
||||||
|
func (pl *InterPodAffinity) EventsToRegister() []framework.ClusterEvent {
|
||||||
|
return []framework.ClusterEvent{
|
||||||
|
// All ActionType includes the following events:
|
||||||
|
// - Delete. An unschedulable Pod may fail due to violating an existing Pod's anti-affinity constraints,
|
||||||
|
// deleting an existing Pod may make it schedulable.
|
||||||
|
// - Update. Updating on an existing Pod's labels (e.g., removal) may make
|
||||||
|
// an unschedulable Pod schedulable.
|
||||||
|
// - Add. An unschedulable Pod may fail due to violating pod-affinity constraints,
|
||||||
|
// adding an assigned Pod may make it schedulable.
|
||||||
|
{Resource: framework.Pod, ActionType: framework.All},
|
||||||
|
{Resource: framework.Node, ActionType: framework.Add | framework.UpdateNodeLabel},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// New initializes a new plugin and returns it.
|
// New initializes a new plugin and returns it.
|
||||||
func New(plArgs runtime.Object, h framework.Handle, fts feature.Features) (framework.Plugin, error) {
|
func New(plArgs runtime.Object, h framework.Handle, fts feature.Features) (framework.Plugin, error) {
|
||||||
if h.SnapshotSharedLister() == nil {
|
if h.SnapshotSharedLister() == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user