estimator

package
v0.0.0-...-386b7fa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//BasicEstimatorName is the name of basic estimator.
	BasicEstimatorName = "basic"
	// BinpackingEstimatorName is the name of binpacking estimator.
	BinpackingEstimatorName = "binpacking"
)

Variables

View Source
var AvailableEstimators = []string{BinpackingEstimatorName, deprecated(BasicEstimatorName)}

AvailableEstimators is a list of available estimators.

Functions

This section is empty.

Types

type BasicNodeEstimator

type BasicNodeEstimator struct {
	FittingPods map[*apiv1.Pod]struct{}
	// contains filtered or unexported fields
}

BasicNodeEstimator estimates the number of needed nodes to handle the given amount of pods. It will never overestimate the number of nodes but is quite likely to provide a number that is too small.

Deprecated. TODO(aleksandra-malinowska): remove this in 1.5.

func NewBasicNodeEstimator

func NewBasicNodeEstimator() *BasicNodeEstimator

NewBasicNodeEstimator builds BasicNodeEstimator.

func (*BasicNodeEstimator) Add

func (basicEstimator *BasicNodeEstimator) Add(pod *apiv1.Pod) error

Add adds Pod to the estimation.

func (*BasicNodeEstimator) Estimate

func (basicEstimator *BasicNodeEstimator) Estimate(pods []*apiv1.Pod, nodeInfo *schedulernodeinfo.NodeInfo, upcomingNodes []*schedulernodeinfo.NodeInfo) int

Estimate estimates the number needed of nodes of the given shape.

func (*BasicNodeEstimator) GetCount

func (basicEstimator *BasicNodeEstimator) GetCount() int

GetCount returns number of pods included in the estimation.

func (*BasicNodeEstimator) GetDebug

func (basicEstimator *BasicNodeEstimator) GetDebug() string

GetDebug returns debug information about the current state of BasicNodeEstimator

type BinpackingNodeEstimator

type BinpackingNodeEstimator struct {
	// contains filtered or unexported fields
}

BinpackingNodeEstimator estimates the number of needed nodes to handle the given amount of pods.

func NewBinpackingNodeEstimator

func NewBinpackingNodeEstimator(predicateChecker *simulator.PredicateChecker) *BinpackingNodeEstimator

NewBinpackingNodeEstimator builds a new BinpackingNodeEstimator.

func (*BinpackingNodeEstimator) Estimate

func (estimator *BinpackingNodeEstimator) Estimate(pods []*apiv1.Pod, nodeTemplate *schedulernodeinfo.NodeInfo,
	upcomingNodes []*schedulernodeinfo.NodeInfo) int

Estimate implements First Fit Decreasing bin-packing approximation algorithm. See https://en.wikipedia.org/wiki/Bin_packing_problem for more details. While it is a multi-dimensional bin packing (cpu, mem, ports) in most cases the main dimension will be cpu thus the estimated overprovisioning of 11/9 * optimal + 6/9 should be still be maintained. It is assumed that all pods from the given list can fit to nodeTemplate. Returns the number of nodes needed to accommodate all pods from the list.

type Estimator

type Estimator interface {
	Estimate([]*apiv1.Pod, *schedulernodeinfo.NodeInfo, []*schedulernodeinfo.NodeInfo) int
}

Estimator calculates the number of nodes of given type needed to schedule pods.

type EstimatorBuilder

type EstimatorBuilder func(*simulator.PredicateChecker) Estimator

EstimatorBuilder creates a new estimator object.

func NewEstimatorBuilder

func NewEstimatorBuilder(name string) (EstimatorBuilder, error)

NewEstimatorBuilder creates a new estimator object from flag.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL