Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterInfo ¶
type ClusterInfo struct {
// contains filtered or unexported fields
}
ClusterInfo is cluster level aggregated information.
func NewClusterInfo ¶
func NewClusterInfo(cluster *v1alpha1.Cluster) *ClusterInfo
NewClusterInfo creates a ClusterInfo object.
func (*ClusterInfo) Cluster ¶
func (n *ClusterInfo) Cluster() *v1alpha1.Cluster
Cluster returns overall information about this cluster.
type ClusterScore ¶
ClusterScore represent the cluster score.
type ClusterScoreList ¶
type ClusterScoreList []ClusterScore
ClusterScoreList declares a list of clusters and their scores.
type Code ¶
type Code int
Code is the Status code/type which is returned from plugins.
const ( // Success means that plugin ran correctly and found resource schedulable. // NOTE: A nil status is also considered as "Success". Success Code = iota // Unschedulable is used when a plugin finds the resource unschedulable. // The accompanying status message should explain why the it is unschedulable. Unschedulable // Error is used for internal plugin errors, unexpected input, etc. Error )
These are predefined codes used in a Status.
type FilterPlugin ¶
type FilterPlugin interface { Plugin // Filter is called by the scheduling framework. Filter(ctx context.Context, placement *v1alpha1.Placement, cluster *cluster.Cluster) *Result }
FilterPlugin is an interface for filter plugins. These filters are used to filter out clusters that are not fit for the resource.
type Framework ¶
type Framework interface { // RunFilterPlugins runs the set of configured Filter plugins for resources on // the given cluster. RunFilterPlugins(ctx context.Context, placement *v1alpha1.Placement, cluster *cluster.Cluster) PluginToResult // RunScorePlugins runs the set of configured Score plugins, it returns a map of plugin name to cores RunScorePlugins(ctx context.Context, placement *v1alpha1.Placement, clusters []*cluster.Cluster) (PluginToClusterScores, error) }
Framework manages the set of plugins in use by the scheduling framework. Configured plugins are called at specified points in a scheduling context.
type Plugin ¶
type Plugin interface {
Name() string
}
Plugin is the parent type for all the scheduling framework plugins.
type PluginToClusterScores ¶
type PluginToClusterScores map[string]ClusterScoreList
PluginToClusterScores declares a map from plugin name to its ClusterScoreList.
type PluginToResult ¶
PluginToResult maps plugin name to Result.
func (PluginToResult) Merge ¶
func (p PluginToResult) Merge() *Result
Merge merges the statuses in the map into one. The resulting status code have the following precedence: Error, Unschedulable.
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result indicates the result of running a plugin. It consists of a code, a message and (optionally) an error. When the status code is not `Success`, the reasons should explain why.
type ScorePlugin ¶
type ScorePlugin interface { Plugin // Score is called on each filtered cluster. It must return success and an integer // indicating the rank of the cluster. All scoring plugins must return success or // the resource will be rejected. Score(ctx context.Context, placement *v1alpha1.Placement, cluster *cluster.Cluster) (float64, *Result) }
ScorePlugin is an interface that must be implemented by "Score" plugins to rank clusters that passed the filtering phase.