Documentation ¶
Overview ¶
Package socketquad contains an out-of-tree plugin based on the Kubernetes scheduling framework.
Index ¶
- Constants
- func New(configuration runtime.Object, f framework.Handle) (framework.Plugin, error)
- type InterferenceModel
- type SocketQuadPlugin
- func (ap *SocketQuadPlugin) Filter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (_ *SocketQuadPlugin) Name() string
- func (_ *SocketQuadPlugin) NormalizeScore(ctx context.Context, state *framework.CycleState, p *corev1.Pod, ...) *framework.Status
- func (ap *SocketQuadPlugin) Score(ctx context.Context, state *framework.CycleState, p *corev1.Pod, ...) (int64, *framework.Status)
- func (ap *SocketQuadPlugin) ScoreExtensions() framework.ScoreExtensions
Constants ¶
const (
// Name is the "official" external name of this scheduling plugin.
Name = "SocketQuadPlugin"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InterferenceModel ¶
type InterferenceModel interface { // Attack returns a float64 that represents the damage inflicted to the // occupant Pod when the attacker Pod is scheduled along with it. Attack(attacker, occupant *corev1.Pod) (float64, error) // ToInt64Multiplier returns an integer that can be used to safely // convert the result of Attack into an int64. // // The aim is to multiply the double-precision floating point number // returned by Attack with this number before casting it to an int64. ToInt64Multiplier() float64 }
InterferenceModel abstracts away the core logic of interference awareness.
It is used by GreedyPlugin across various scheduling extension points, and exposes the generalized functionality that should be provided to SocketQuadPlugin.
type SocketQuadPlugin ¶
type SocketQuadPlugin struct {
// contains filtered or unexported fields
}
SocketQuadPlugin is an out-of-tree plugin for the kube-scheduler, which takes into account information about the slowdown of colocated applications when they are wrapped into Pods and scheduled on the Kubernetes cluster.
func (*SocketQuadPlugin) Filter ¶
func (ap *SocketQuadPlugin) Filter( ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeInfo *framework.NodeInfo, ) *framework.Status
Filter is called by the scheduling framework.
All FilterPlugins should return "Success" to declare that the given node fits the pod. If Filter doesn't return "Success", it will return "Unschedulable", "UnschedulableAndUnresolvable" or "Error".
For the node being evaluated, Filter plugins should look at the passed nodeInfo reference for this particular node's information (e.g., pods considered to be running on the node) instead of looking it up in the NodeInfoSnapshot because we don't guarantee that they will be the same.
For example, during preemption, we may pass a copy of the original nodeInfo object that has some pods removed from it to evaluate the possibility of preempting them to schedule the target pod.
func (*SocketQuadPlugin) Name ¶
func (_ *SocketQuadPlugin) Name() string
Name returns the official name of the SocketQuadPlugin.
func (*SocketQuadPlugin) NormalizeScore ¶
func (_ *SocketQuadPlugin) NormalizeScore( ctx context.Context, state *framework.CycleState, p *corev1.Pod, scores framework.NodeScoreList, ) *framework.Status
NormalizeScore is called for all node scores produced by the same plugin's "Score" method. A successful run of NormalizeScore will update the scores list and return a success status.
In the case of the SocketQuadPlugin, its "Score" method produces scores of reverse priority (i.e., the lower the score, the better the result). Therefore all scores have to be reversed during the normalization, so that higher score indicates a better scheduling result in terms of slowdowns.
func (*SocketQuadPlugin) Score ¶
func (ap *SocketQuadPlugin) Score( ctx context.Context, state *framework.CycleState, p *corev1.Pod, nodeName string, ) (int64, *framework.Status)
Score is called on each filtered node. It must return success and an integer indicating the rank of the node. All scoring plugins must return success or the pod will be rejected.
In the case of SocketQuadPlugin, scoring is reversed; i.e., higher score indicates worse scheduling decision. This is taken into account and "fixed" later, during the normalization.
func (*SocketQuadPlugin) ScoreExtensions ¶
func (ap *SocketQuadPlugin) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions returns the SocketQuadPlugin itself, since it implements the framework.ScoreExtensions interface.
Directories ¶
Path | Synopsis |
---|---|
Package hardcoded contains an implementation of socketquad.InterferenceModel, where the slowdowns among all applications are known and hardcoded.
|
Package hardcoded contains an implementation of socketquad.InterferenceModel, where the slowdowns among all applications are known and hardcoded. |