workloadantiaffinity

package
v1.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is the name of the plugin used in the plugin registry and configurations.
	Name = "WorkloadAntiAffinity"
)

Variables

This section is empty.

Functions

func New

func New() (framework.Plugin, error)

New instantiates the workload anti-affinity plugin.

Types

type WorkloadAntiAffinity

type WorkloadAntiAffinity struct{}

WorkloadAntiAffinity is a plugin that checks if a cluster matches the workload anti-affinity group constraint. It separates workloads in the same anti-affinity group across different clusters.

func (*WorkloadAntiAffinity) Filter

Filter implements FilterPlugin interface for backward compatibility. TODO(@RainbowMango): Reconsider the plugin architecture to avoid requiring new plugins to implement this interface. This method should never be called as the framework will use FilterWithContext when available.

func (*WorkloadAntiAffinity) FilterWithContext

func (p *WorkloadAntiAffinity) FilterWithContext(filterCtx *framework.FilterContext) *framework.Result

FilterWithContext checks if the cluster matches the workload anti-affinity group constraint. It only implements the new FilterWithContext interface and does not implement the old Filter interface. If the binding has a workload anti-affinity group specified, it ensures the cluster is not selected if it matches the anti-affinity group criteria.

func (*WorkloadAntiAffinity) Name

func (p *WorkloadAntiAffinity) Name() string

Name returns the plugin name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL