Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiffQuantitiesAsPercent ¶
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 ¶
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
func TotalRecommendations(vpa *vpav1.VerticalPodAutoscaler, rt RecommendationType) ResourceQuantities
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.