Documentation ¶
Index ¶
Constants ¶
View Source
const ( // MemoryLimitBumpUpRatio specifies how much memory will be available above memory request. // Limit is set to trigger OOMs. MemoryLimitBumpUpRatio float64 = 1.2 // MemoryLimitMinBumpUp specifies minimal amount of memory above memory request. // Limit is set to trigger OOMs. MemoryLimitMinBumpUp float64 = 100 * 1024 * 1024 // 100MB )
Variables ¶
This section is empty.
Functions ¶
func NewRecommendationProvider ¶
func NewRecommendationProvider(vpaLister vpa_lister.VerticalPodAutoscalerLister, recommendationProcessor vpa_api_util.RecommendationProcessor) *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) *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 ContainerResources ¶
type ContainerResources struct {
Requests, Limits v1.ResourceList
}
ContainerResources holds request and limit resources for container
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 *v1.Pod) ([]ContainerResources, string, error)
}
RecommendationProvider gets current recommendation and limits for the given pod.
Click to show internal directories.
Click to hide internal directories.