estimator

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0, BSD-2-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinCpuResource    = 100
	MinMemoryResource = 256 * 1024 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExternalResourceEstimator

type ExternalResourceEstimator struct {
	Type     string
	Priority int
}

func (*ExternalResourceEstimator) DeleteEstimation

func (*ExternalResourceEstimator) GetResourceEstimation

func (e *ExternalResourceEstimator) GetResourceEstimation(evpa *autoscalingapi.EffectiveVerticalPodAutoscaler, config map[string]string, containerName string, currRes *corev1.ResourceRequirements) (corev1.ResourceList, error)

type OOMResourceEstimator

type OOMResourceEstimator struct {
	OOMRecorder oom.Recorder
}

func (*OOMResourceEstimator) DeleteEstimation

func (*OOMResourceEstimator) GetResourceEstimation

func (e *OOMResourceEstimator) GetResourceEstimation(evpa *autoscalingapi.EffectiveVerticalPodAutoscaler, config map[string]string, containerName string, currRes *corev1.ResourceRequirements) (corev1.ResourceList, error)

type PercentileResourceEstimator added in v0.4.0

type PercentileResourceEstimator struct {
	Predictor     prediction.Interface
	Client        client.Client
	TargetFetcher target.SelectorFetcher
}

func (*PercentileResourceEstimator) DeleteEstimation added in v0.4.0

func (*PercentileResourceEstimator) GetResourceEstimation added in v0.4.0

type ProportionalResourceEstimator

type ProportionalResourceEstimator struct {
	client.Client
}

func (*ProportionalResourceEstimator) DeleteEstimation

func (*ProportionalResourceEstimator) GetResourceEstimation

type ResourceEstimator

type ResourceEstimator interface {

	// GetResourceEstimation get estimated resource result for an EffectiveVPA and related configs
	GetResourceEstimation(evpa *autoscalingapi.EffectiveVerticalPodAutoscaler, config map[string]string, containerName string, currRes *corev1.ResourceRequirements) (corev1.ResourceList, error)

	// DeleteEstimation delete related resource from an EffectiveVPA
	DeleteEstimation(evpa *autoscalingapi.EffectiveVerticalPodAutoscaler)
}

ResourceEstimator defines the implement for build-in estimator

type ResourceEstimatorInstance

type ResourceEstimatorInstance interface {
	ResourceEstimator

	// GetSpec return the spec for this instance
	GetSpec() autoscalingapi.ResourceEstimator
}

ResourceEstimatorInstance is the instance that used for container scaling

type ResourceEstimatorManager

type ResourceEstimatorManager interface {

	// GetEstimators get estimator instances based on EffectiveVPA spec
	GetEstimators(evpa *autoscalingapi.EffectiveVerticalPodAutoscaler) []ResourceEstimatorInstance

	// DeleteEstimators release estimator resources based on EffectiveVPA spec
	DeleteEstimators(evpa *autoscalingapi.EffectiveVerticalPodAutoscaler)
}

ResourceEstimatorManager controls how to get or delete estimators for EffectiveVPA

func NewResourceEstimatorManager

func NewResourceEstimatorManager(client client.Client, fetcher target.SelectorFetcher, oomRecorder oom.Recorder, predictor prediction.Interface) ResourceEstimatorManager

Jump to

Keyboard shortcuts

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