Documentation
¶
Index ¶
- Constants
- func NewScheduler(_ runtime.Object, handle framework.Handle) (framework.Plugin, error)
- type OndemandSpotBalancer
- func (*OndemandSpotBalancer) AddPod(ctx context.Context, cycleState *framework.CycleState, ...) *framework.Status
- func (osb *OndemandSpotBalancer) Filter(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (*OndemandSpotBalancer) Name() string
- func (osb *OndemandSpotBalancer) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (osb *OndemandSpotBalancer) PreFilter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod) (*framework.PreFilterResult, *framework.Status)
- func (osb *OndemandSpotBalancer) PreFilterExtensions() framework.PreFilterExtensions
- func (*OndemandSpotBalancer) RemovePod(ctx context.Context, cycleState *framework.CycleState, ...) *framework.Status
- func (osb *OndemandSpotBalancer) Score(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, ...) (int64, *framework.Status)
- func (osb *OndemandSpotBalancer) ScoreExtensions() framework.ScoreExtensions
- type PreFilterState
Constants ¶
const SchedulerName = "OndemandSpotBalancer"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type OndemandSpotBalancer ¶
NetworkOverhead : Filter and Score nodes based on Pod's AppGroup requirements: MaxNetworkCosts requirements among Pods with dependencies
func (*OndemandSpotBalancer) Filter ¶
func (osb *OndemandSpotBalancer) Filter(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, nodeInfo *framework.NodeInfo) *framework.Status
Filter performs the following operations: 1. Get the % in ondemand/spot from PreFilterState 2. Get the node type (ondemand/spot) 2. Check if the pod can be added to the node. If ondemand/spot % is met, allow. otherwise fail
func (*OndemandSpotBalancer) Name ¶
func (*OndemandSpotBalancer) Name() string
func (*OndemandSpotBalancer) NormalizeScore ¶
func (osb *OndemandSpotBalancer) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, scores framework.NodeScoreList) *framework.Status
NormalizeScore : normalize scores since lower scores correspond to lower priority
func (*OndemandSpotBalancer) PreFilter ¶
func (osb *OndemandSpotBalancer) PreFilter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod) (*framework.PreFilterResult, *framework.Status)
PreFilter performs the following operations: 1. Get the owner 2. Get desired % of ondemand/spot from deployment annotation 3. Get the list of pods belonging to the app 4. Get the list of nodes running the pods 5. Calculate the current % in ondemand/spot 6. Calculate the % in ondemand/spot, after adding new po 7. Save desired % and calculated % to PreFilterState
func (*OndemandSpotBalancer) PreFilterExtensions ¶
func (osb *OndemandSpotBalancer) PreFilterExtensions() framework.PreFilterExtensions
PreFilterExtensions is used for updating plugin state when a pod is added or removed (for preemption). This plugin is stateless, so these functions are not needed
func (*OndemandSpotBalancer) Score ¶
func (osb *OndemandSpotBalancer) Score(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, nodeName string) (int64, *framework.Status)
Score performs the following operations: 1. Get the % in ondemand/spot from PreFilterState 2. Get the type of current node 3. Set the score for the node. score = calcalated % - desried %
func (*OndemandSpotBalancer) ScoreExtensions ¶
func (osb *OndemandSpotBalancer) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions : an interface for Score extended functionality
type PreFilterState ¶
type PreFilterState struct {
// contains filtered or unexported fields
}
PreFilterState computed at PreFilter and used at Filter and Score.