logic

package
v0.0.0-...-386b7fa Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRecommendationProvider

func NewRecommendationProvider(vpaLister vpa_lister.VerticalPodAutoscalerLister, recommendationProcessor vpa_api_util.RecommendationProcessor, selectorFetcher target.VpaTargetSelectorFetcher) *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) *AdmissionServer

NewAdmissionServer constructs new AdmissionServer

func (*AdmissionServer) Serve

Serve is a handler function of AdmissionServer

type ContainerResources

type ContainerResources struct {
	Limits   v1.ResourceList
	Requests v1.ResourceList
}

ContainerResources holds resources request for container

type NoopPreProcessor

type NoopPreProcessor struct{}

NoopPreProcessor leaves pods unchanged when processing

func (*NoopPreProcessor) Process

func (p *NoopPreProcessor) Process(pod apiv1.Pod) (apiv1.Pod, error)

Process leaves the pod unchanged

type PodPreProcessor

type PodPreProcessor interface {
	Process(apiv1.Pod) (apiv1.Pod, error)
}

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, 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

Jump to

Keyboard shortcuts

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