Documentation
¶
Index ¶
Constants ¶
const (
// Name is the name of the plugin used in the plugin registry and configurations.
Name = "WorkloadAntiAffinity"
)
Variables ¶
This section is empty.
Functions ¶
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 ¶
func (p *WorkloadAntiAffinity) Filter(context.Context, *workv1alpha2.ResourceBindingSpec, *workv1alpha2.ResourceBindingStatus, *clusterv1alpha1.Cluster) *framework.Result
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.