vpa

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffQuantitiesAsPercent

func DiffQuantitiesAsPercent(req, rec *resource.Quantity) *float64

DiffQuantitiesAsPercent return the difference between two quantities. The return value is expressed as the increase/decrease of the request in terms of the recommendation.

Types

type RecommendationType added in v0.3.0

type RecommendationType string

RecommendationType represents a type of container resources recommendation made by a VPA recommender.

const (
	RecommendationTarget         RecommendationType = "target"
	RecommendationLowerBound     RecommendationType = "lower-bound"
	RecommendationUpperBound     RecommendationType = "upper-bound"
	RecommendationUncappedTarget RecommendationType = "uncapped-target"
)

VPA recommendation types.

func (*RecommendationType) Set added in v0.3.0

func (rt *RecommendationType) Set(s string) error

Set implements the pflag.Value interface.

func (RecommendationType) String added in v0.3.0

func (rt RecommendationType) String() string

String implements the pflag.Value interface.

func (*RecommendationType) Type added in v0.3.0

func (rt *RecommendationType) Type() string

Type implements the pflag.Value interface.

type ResourceQuantities

type ResourceQuantities struct {
	CPU    *resource.Quantity
	Memory *resource.Quantity
}

ResourceQuantities is a pair of resource quantities that can represent the recommendations of a VerticalPodAutoscaler of the requests of a pod's container.

func TotalRecommendations added in v0.3.0

TotalRecommendations returns the total resource recommendations of the given VPA as the sum of all resource quantities recommended for each container.

type TargetController

type TargetController struct {
	Name             string
	Namespace        string
	GroupVersionKind schema.GroupVersionKind
	// contains filtered or unexported fields
}

TargetController abstract a scalable controller resource targeted by a VerticalPodAutoscaler.

func NewTargetController

func NewTargetController(c client.Interface, ref *autoscalingv1.CrossVersionObjectReference, namespace string) (*TargetController, error)

NewTargetController resolves the target of a VPA resource.

func (*TargetController) GetContainerRequests

func (tc *TargetController) GetContainerRequests(name string) ResourceQuantities

GetContainerRequests returns the resource requests of a container.

func (*TargetController) GetRequests

func (tc *TargetController) GetRequests() ResourceQuantities

GetRequests returns the resource requests defined by the pod spec of the controller, which is the sum of all resource quantities for each container declared by the spec.

func (*TargetController) ReplicasCount added in v0.4.2

func (tc *TargetController) ReplicasCount() (int64, error)

ReplicasCount returns the number of replicas of the controller. It is used to scale the resource/recommendation statistics to get real usage values that reflect the number of pods schedules for each target controller.

Jump to

Keyboard shortcuts

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