Documentation ¶
Overview ¶
Package clusteraffinity features a scheduler plugin that enforces cluster affinity (if any) defined on a CRP.
Index ¶
- type AffinityTerms
- type Option
- type Plugin
- func (p *Plugin) Filter(_ context.Context, state framework.CycleStatePluginReadWriter, ...) (status *framework.Status)
- func (p *Plugin) Name() string
- func (p *Plugin) PreFilter(_ context.Context, state framework.CycleStatePluginReadWriter, ...) (status *framework.Status)
- func (p *Plugin) PreScore(_ context.Context, state framework.CycleStatePluginReadWriter, ...) (status *framework.Status)
- func (p *Plugin) Score(_ context.Context, state framework.CycleStatePluginReadWriter, ...) (score *framework.ClusterScore, status *framework.Status)
- func (p *Plugin) SetUpWithFramework(handle framework.Handle)
- type PreferredAffinityTerms
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AffinityTerms ¶
type AffinityTerms []affinityTerm
AffinityTerms is a "processed" representation of []ClusterSelectorTerms. The terms are `ORed`.
func NewAffinityTerms ¶
func NewAffinityTerms(terms []placementv1beta1.ClusterSelectorTerm) (AffinityTerms, error)
NewAffinityTerms returns the list of processed affinity terms.
func (AffinityTerms) Matches ¶
func (at AffinityTerms) Matches(cluster *clusterv1beta1.MemberCluster) bool
Matches returns true if the cluster matches one of the terms.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin is the scheduler plugin that enforces the cluster affinity (if any) defined on a CRP.
func (*Plugin) Filter ¶
func (p *Plugin) Filter( _ context.Context, state framework.CycleStatePluginReadWriter, _ *placementv1beta1.ClusterSchedulingPolicySnapshot, cluster *clusterv1beta1.MemberCluster, ) (status *framework.Status)
Filter allows the plugin to connect to the Filter extension point in the scheduling framework.
func (*Plugin) PreFilter ¶
func (p *Plugin) PreFilter( _ context.Context, state framework.CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot, ) (status *framework.Status)
PreFilter allows the plugin to connect to the PreFilter extension point in the scheduling framework.
Note that the scheduler will not run this extension point in parallel.
func (*Plugin) PreScore ¶
func (p *Plugin) PreScore( _ context.Context, state framework.CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot, ) (status *framework.Status)
PreScore allows the plugin to connect to the PreScore extension point in the scheduling framework.
func (*Plugin) Score ¶
func (p *Plugin) Score( _ context.Context, state framework.CycleStatePluginReadWriter, _ *placementv1beta1.ClusterSchedulingPolicySnapshot, cluster *clusterv1beta1.MemberCluster, ) (score *framework.ClusterScore, status *framework.Status)
Score allows the plugin to connect to the Score extension point in the scheduling framework.
func (*Plugin) SetUpWithFramework ¶
SetUpWithFramework sets up this plugin with a scheduler framework.
type PreferredAffinityTerms ¶
type PreferredAffinityTerms []preferredAffinityTerm
PreferredAffinityTerms is a "processed" representation of []PreferredClusterSelector.
func NewPreferredAffinityTerms ¶
func NewPreferredAffinityTerms(terms []placementv1beta1.PreferredClusterSelector) (PreferredAffinityTerms, error)
NewPreferredAffinityTerms returns the list of processed preferred affinity terms.
func (PreferredAffinityTerms) Score ¶
func (t PreferredAffinityTerms) Score(cluster *clusterv1beta1.MemberCluster) int32
Score returns a score for a cluster: the sum of the weights of the terms that match the cluster.