estimator

package
v0.0.0-...-dcfb068 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultEstimatorName = "defaultEstimator"

	// DefaultMilliCPURequest defines default milli cpu request number.
	DefaultMilliCPURequest int64 = 250 // 0.25 core
	// DefaultMemoryRequest defines default memory request size.
	DefaultMemoryRequest int64 = 200 * 1024 * 1024 // 200 MiB
)
View Source
const (
	NodeMetricEstimatorName = "nodeMetricEstimator"

	DefaultNodeMetricExpirationSeconds = 30 // TODO: revisit this.
)

Variables

View Source
var Estimators = map[string]FactoryFn{
	DefaultEstimatorName:    NewDefaultEstimator,
	NodeMetricEstimatorName: NewNodeMetricEstimator,
}

Functions

func PodRequestsAndLimits

func PodRequestsAndLimits(pod *corev1.Pod) (reqs, limits corev1.ResourceList)

PodRequestsAndLimits returns a dictionary of all defined resources summed up for all containers of the pod. If PodOverhead feature is enabled, pod overhead is added to the total container resource requests and to the total container limits which have a non-zero quantity.

Types

type DefaultEstimator

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

func (*DefaultEstimator) EstimateNode

func (e *DefaultEstimator) EstimateNode(nodeInfo framework.NodeInfo, resourceType podutil.PodResourceType) (*framework.Resource, error)

func (*DefaultEstimator) EstimatePod

func (e *DefaultEstimator) EstimatePod(pod *corev1.Pod) (*framework.Resource, error)

func (*DefaultEstimator) Name

func (e *DefaultEstimator) Name() string

func (*DefaultEstimator) ValidateNode

type Estimator

type Estimator interface {
	Name() string
	ValidateNode(nodeInfo framework.NodeInfo, resourceType podutil.PodResourceType) *framework.Status
	EstimatePod(pod *corev1.Pod) (*framework.Resource, error)
	EstimateNode(info framework.NodeInfo, resourceType podutil.PodResourceType) (*framework.Resource, error)
}

func NewNodeMetricEstimator

func NewNodeMetricEstimator(args *config.LoadAwareArgs, handle framework.SchedulerFrameworkHandle) (Estimator, error)

type FactoryFn

type FactoryFn func(args *config.LoadAwareArgs, handle framework.SchedulerFrameworkHandle) (Estimator, error)

type NodeMetricEstimator

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

func (*NodeMetricEstimator) EstimateNode

func (e *NodeMetricEstimator) EstimateNode(nodeInfo framework.NodeInfo, resourceType podutil.PodResourceType) (*framework.Resource, error)

func (*NodeMetricEstimator) EstimatePod

func (e *NodeMetricEstimator) EstimatePod(pod *v1.Pod) (*framework.Resource, error)

func (*NodeMetricEstimator) Name

func (e *NodeMetricEstimator) Name() string

func (*NodeMetricEstimator) ValidateNode

func (e *NodeMetricEstimator) ValidateNode(nodeInfo framework.NodeInfo, resourceType podutil.PodResourceType) *framework.Status

Jump to

Keyboard shortcuts

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