Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContainerNameToAggregateStateMap ¶
func GetContainerNameToAggregateStateMap(vpa *model.Vpa) model.ContainerNameToAggregateStateMap
GetContainerNameToAggregateStateMap returns ContainerNameToAggregateStateMap for pods.
Types ¶
type CappingPostProcessor ¶ added in v0.13.0
type CappingPostProcessor struct{}
CappingPostProcessor ensure that the policy is applied to recommendation it applies policy for fields: MinAllowed and MaxAllowed
func (CappingPostProcessor) Process ¶ added in v0.13.0
func (c CappingPostProcessor) Process(vpa *vpa_types.VerticalPodAutoscaler, recommendation *vpa_types.RecommendedPodResources) *vpa_types.RecommendedPodResources
Process apply the capping post-processing to the recommendation. (use to be function getCappedRecommendation)
type IntegerCPUPostProcessor ¶ added in v0.13.0
type IntegerCPUPostProcessor struct{}
IntegerCPUPostProcessor ensures that the recommendation delivers an integer value for CPU This is need for users who want to use CPU Management with static policy: https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#static-policy
func (*IntegerCPUPostProcessor) Process ¶ added in v0.13.0
func (p *IntegerCPUPostProcessor) Process(vpa *vpa_types.VerticalPodAutoscaler, recommendation *vpa_types.RecommendedPodResources) *vpa_types.RecommendedPodResources
Process apply the capping post-processing to the recommendation. For this post processor the CPU value is rounded up to an integer
type RecommendationPostProcessor ¶ added in v0.13.0
type RecommendationPostProcessor interface {
Process(vpa *vpa_types.VerticalPodAutoscaler, recommendation *vpa_types.RecommendedPodResources) *vpa_types.RecommendedPodResources
}
RecommendationPostProcessor can amend the recommendation according to the defined policies
type Recommender ¶
type Recommender interface { // RunOnce performs one iteration of recommender duties followed by update of recommendations in VPA objects. RunOnce() // GetClusterState returns ClusterState used by Recommender GetClusterState() *model.ClusterState // GetClusterStateFeeder returns ClusterStateFeeder used by Recommender GetClusterStateFeeder() input.ClusterStateFeeder // UpdateVPAs computes recommendations and sends VPAs status updates to API Server UpdateVPAs() // MaintainCheckpoints stores current checkpoints in API Server and garbage collect old ones // MaintainCheckpoints writes at least minCheckpoints if there are more checkpoints to write. // Checkpoints are written until ctx permits or all checkpoints are written. MaintainCheckpoints(ctx context.Context, minCheckpoints int) }
Recommender recommend resources for certain containers, based on utilization periodically got from metrics api.
type RecommenderFactory ¶
type RecommenderFactory struct { ClusterState *model.ClusterState ClusterStateFeeder input.ClusterStateFeeder ControllerFetcher controllerfetcher.ControllerFetcher CheckpointWriter checkpoint.CheckpointWriter PodResourceRecommender logic.PodResourceRecommender VpaClient vpa_api.VerticalPodAutoscalersGetter RecommendationPostProcessors []RecommendationPostProcessor CheckpointsGCInterval time.Duration UseCheckpoints bool }
RecommenderFactory makes instances of Recommender.
func (RecommenderFactory) Make ¶
func (c RecommenderFactory) Make() Recommender
Make creates a new recommender instance, which can be run in order to provide continuous resource recommendations for containers.