Documentation ¶
Index ¶
- Constants
- Variables
- func New(_ runtime.Object, fh framework.Handle) (framework.Plugin, error)
- func PodCPURequestOrLimit(pod *corev1.Pod) (v float64)
- func PowerConsumptions2Scores(scores framework.NodeScoreList)
- type MinimizePower
- func (*MinimizePower) Name() string
- func (pl *MinimizePower) NormalizeScore(_ context.Context, _ *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (pl *MinimizePower) PreFilter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod) (*framework.PreFilterResult, *framework.Status)
- func (pl *MinimizePower) PreFilterExtensions() framework.PreFilterExtensions
- func (pl *MinimizePower) Score(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) (int64, *framework.Status)
- func (pl *MinimizePower) ScoreExtensions() framework.ScoreExtensions
Constants ¶
View Source
const ( // MetricsCacheTTL is the expiration time of the metrics cache. MetricsCacheTTL = 15 * time.Second // PredictorCacheTTL is the expiration time of the predictor cache. PredictorCacheTTL = 10 * time.Minute )
Variables ¶
View Source
var ( Name = "MinimizePower" ReasonResourceRequest = "at least one container in the pod must have a requests.cpu or limits.cpu set" )
Functions ¶
func PodCPURequestOrLimit ¶
func PowerConsumptions2Scores ¶
func PowerConsumptions2Scores(scores framework.NodeScoreList)
Types ¶
type MinimizePower ¶
type MinimizePower struct {
// contains filtered or unexported fields
}
func (*MinimizePower) Name ¶
func (*MinimizePower) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*MinimizePower) NormalizeScore ¶
func (pl *MinimizePower) NormalizeScore(_ context.Context, _ *framework.CycleState, pod *corev1.Pod, scores framework.NodeScoreList) *framework.Status
func (*MinimizePower) PreFilter ¶
func (pl *MinimizePower) PreFilter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod) (*framework.PreFilterResult, *framework.Status)
PreFilter rejects a pod if it does not have at least one container that has a CPU request or limit set.
func (*MinimizePower) PreFilterExtensions ¶
func (pl *MinimizePower) PreFilterExtensions() framework.PreFilterExtensions
PreFilterExtensions returns nil as this plugin does not have PreFilterExtensions.
func (*MinimizePower) Score ¶
func (pl *MinimizePower) Score(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeName string) (int64, *framework.Status)
Score returns how many watts will be increased by the given pod (lower is better).
This function never returns an error (as errors cause the pod to be rejected). If an error occurs, it is logged and the score is set to math.MaxInt64.
func (*MinimizePower) ScoreExtensions ¶
func (pl *MinimizePower) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions returns a ScoreExtensions interface.
Click to show internal directories.
Click to hide internal directories.