Documentation ¶
Index ¶
- func GetContainersResources(pod *core.Pod, podRecommendation vpa_types.RecommendedPodResources, ...) []vpa_api_util.ContainerResources
- func NewRecommendationProvider(calculator limitrange.LimitRangeCalculator, ...) *recommendationProvider
- type AdmissionServer
- type NoopPreProcessor
- type PodPreProcessor
- type RecommendationProvider
- type VpaPreProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContainersResources ¶
func GetContainersResources(pod *core.Pod, podRecommendation vpa_types.RecommendedPodResources, limitRange *core.LimitRangeItem, annotations vpa_api_util.ContainerToAnnotationsMap) []vpa_api_util.ContainerResources
GetContainersResources returns the recommended resources for each container in the given pod in the same order they are specified in the pod.Spec.
func NewRecommendationProvider ¶
func NewRecommendationProvider(calculator limitrange.LimitRangeCalculator, recommendationProcessor vpa_api_util.RecommendationProcessor, selectorFetcher target.VpaTargetSelectorFetcher, vpaLister vpa_lister.VerticalPodAutoscalerLister) *recommendationProvider
NewRecommendationProvider constructs the recommendation provider that list VPAs and can be used to determine recommendations for pods.
Types ¶
type AdmissionServer ¶
type AdmissionServer struct {
// contains filtered or unexported fields
}
AdmissionServer is an admission webhook server that modifies pod resources request based on VPA recommendation
func NewAdmissionServer ¶
func NewAdmissionServer(recommendationProvider RecommendationProvider, podPreProcessor PodPreProcessor, vpaPreProcessor VpaPreProcessor, limitsChecker limitrange.LimitRangeCalculator) *AdmissionServer
NewAdmissionServer constructs new AdmissionServer
func (*AdmissionServer) Serve ¶
func (s *AdmissionServer) Serve(w http.ResponseWriter, r *http.Request)
Serve is a handler function of AdmissionServer
type NoopPreProcessor ¶
type NoopPreProcessor struct{}
NoopPreProcessor leaves pods unchanged when processing
type PodPreProcessor ¶
PodPreProcessor processes the pods before building patches.
func NewDefaultPodPreProcessor ¶
func NewDefaultPodPreProcessor() PodPreProcessor
NewDefaultPodPreProcessor creates a default PodPreProcessor
type RecommendationProvider ¶
type RecommendationProvider interface {
GetContainersResourcesForPod(pod *core.Pod) ([]vpa_api_util.ContainerResources, vpa_api_util.ContainerToAnnotationsMap, string, error)
}
RecommendationProvider gets current recommendation, annotations and vpaName for the given pod.
type VpaPreProcessor ¶
type VpaPreProcessor interface {
Process(vpa *vpa_types.VerticalPodAutoscaler, isCreate bool) (*vpa_types.VerticalPodAutoscaler, error)
}
VpaPreProcessor processes the VPAs before applying default .
func NewDefaultVpaPreProcessor ¶
func NewDefaultVpaPreProcessor() VpaPreProcessor
NewDefaultVpaPreProcessor creates a VpaPreProcessor that leaves VPAs unchanged and returns no error