Documentation ¶
Index ¶
- Constants
- Variables
- func SortContainersByContainerName(containers []Container)
- func ValidateAndExtractAlgorithmPolicy(algorithmPolicyReq v1alpha1.AlgorithmPolicy) (v1alpha1.AlgorithmPolicy, *errortypes.CustomError)
- func ValidateAndExtractTargetRef(targetRefReq v1alpha1.CrossVersionObjectReference) (v1alpha1.CrossVersionObjectReference, *errortypes.CustomError)
- type ByContainerName
- type Config
- type Container
- type ContainerConfig
- type Recommendation
Constants ¶
View Source
const ( PercentileAlgorithmType = "percentile" // DefaultAlgorithmType use percentile as the default algorithm DefaultAlgorithmType = PercentileAlgorithmType )
View Source
const ( DefaultUsageBuffer = 30 MaxUsageBuffer = 100 MinUsageBuffer = 0 )
View Source
const (
ContainerPolicySelectAllFlag = "*"
)
View Source
const (
DefaultRecommenderType = "default"
)
View Source
const ( // TargetRefKindDeployment is Deployment TargetRefKindDeployment string = "Deployment" )
Variables ¶
View Source
var AlgorithmTypes = []string{PercentileAlgorithmType}
View Source
var ResourceNames = []v1.ResourceName{v1.ResourceCPU, v1.ResourceMemory}
View Source
var SupportControlledValues = []v1alpha1.ContainerControlledValues{v1alpha1.ContainerControlledValuesRequestsOnly}
View Source
var TargetRefKinds = []string{TargetRefKindDeployment}
Functions ¶
func SortContainersByContainerName ¶
func SortContainersByContainerName(containers []Container)
func ValidateAndExtractAlgorithmPolicy ¶
func ValidateAndExtractAlgorithmPolicy(algorithmPolicyReq v1alpha1.AlgorithmPolicy) ( v1alpha1.AlgorithmPolicy, *errortypes.CustomError, )
func ValidateAndExtractTargetRef ¶
func ValidateAndExtractTargetRef(targetRefReq v1alpha1.CrossVersionObjectReference) ( v1alpha1.CrossVersionObjectReference, *errortypes.CustomError, )
Types ¶
type ByContainerName ¶
type ByContainerName []Container
func (ByContainerName) Len ¶
func (c ByContainerName) Len() int
func (ByContainerName) Less ¶
func (c ByContainerName) Less(i, j int) bool
func (ByContainerName) Swap ¶
func (c ByContainerName) Swap(i, j int)
type Config ¶
type Config struct { TargetRef v1alpha1.CrossVersionObjectReference Containers []Container AlgorithmPolicy v1alpha1.AlgorithmPolicy }
type Container ¶
type Container struct { ContainerName string ContainerConfigs []ContainerConfig }
func ValidateAndExtractContainers ¶
func ValidateAndExtractContainers(ctx context.Context, client k8sclient.Client, namespace string, targetRef v1alpha1.CrossVersionObjectReference, containerPolicies []v1alpha1.ContainerResourcePolicy) ( []Container, *errortypes.CustomError, )
type ContainerConfig ¶
type ContainerConfig struct { ControlledResource v1.ResourceName ResourceBufferPercent int32 }
type Recommendation ¶
type Recommendation struct { types.NamespacedName ObservedGeneration int64 Config // Map of the status conditions (keys are condition types). Conditions *conditionstypes.ResourceRecommendConditionsMap Recommendations []v1alpha1.ContainerResources }
func NewRecommendation ¶
func NewRecommendation(resourceRecommend *v1alpha1.ResourceRecommend) *Recommendation
func (*Recommendation) AsStatus ¶
func (r *Recommendation) AsStatus() v1alpha1.ResourceRecommendStatus
AsStatus returns this objects equivalent of VPA Status.
func (*Recommendation) SetConfig ¶
func (r *Recommendation) SetConfig(ctx context.Context, client k8sclient.Client, resourceRecommend *v1alpha1.ResourceRecommend, ) *errortypes.CustomError
Click to show internal directories.
Click to hide internal directories.