workloadaffinity

package
v1.17.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 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 = "WorkloadAffinity"
)

Variables

This section is empty.

Functions

func New

func New() (framework.Plugin, error)

New instantiates the workload affinity plugin.

Types

type WorkloadAffinity

type WorkloadAffinity struct{}

WorkloadAffinity is a plugin that checks if a cluster matches the workload affinity group constraint. It ensures workloads in the same affinity group are scheduled to the same cluster.

func (*WorkloadAffinity) 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 (*WorkloadAffinity) FilterWithContext

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

FilterWithContext checks if the cluster matches the workload affinity group constraint. It only implements the new FilterWithContext interface and does not implement the old Filter interface. If the binding has a workload affinity group specified, it ensures the cluster is selected only if it matches the affinity group criteria (same cluster as other workloads in the group).

func (*WorkloadAffinity) Name

func (p *WorkloadAffinity) 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