Documentation ¶
Index ¶
- Constants
- func GetNormalizedResource(cpu, mem *resource.Quantity, specs []Specification) (resource.Quantity, resource.Quantity)
- func NewResourceRecommender(recommender apis.Recommender, ...) (recommender.Recommender, error)
- type PatchResource
- type PatchResourcePodSpec
- type PatchResourcePodTemplateSpec
- type PatchResourceSpec
- type ResourceRecommender
- func (rr *ResourceRecommender) CheckDataProviders(ctx *framework.RecommendationContext) error
- func (rr *ResourceRecommender) CollectData(ctx *framework.RecommendationContext) error
- func (rr *ResourceRecommender) Filter(ctx *framework.RecommendationContext) error
- func (rr *ResourceRecommender) MemoryOOMProtection(oomRecords []oom.OOMRecord, namespace string, workloadName string, ...) *resource.Quantity
- func (rr *ResourceRecommender) Name() string
- func (rr *ResourceRecommender) Observe(ctx *framework.RecommendationContext) error
- func (rr *ResourceRecommender) Policy(ctx *framework.RecommendationContext) error
- func (rr *ResourceRecommender) PostProcessing(ctx *framework.RecommendationContext) error
- func (rr *ResourceRecommender) PreRecommend(ctx *framework.RecommendationContext) error
- func (rr *ResourceRecommender) Recommend(ctx *framework.RecommendationContext) error
- type Specification
Constants ¶
View Source
const DefaultSpecs = "" /* 191-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func GetNormalizedResource ¶ added in v0.9.0
func NewResourceRecommender ¶
func NewResourceRecommender(recommender apis.Recommender, recommendationRule analysisv1alph1.RecommendationRule) (recommender.Recommender, error)
NewResourceRecommender create a new resource recommender.
Types ¶
type PatchResource ¶ added in v0.8.0
type PatchResource struct {
Spec PatchResourceSpec `json:"spec,omitempty"`
}
type PatchResourcePodSpec ¶ added in v0.8.0
type PatchResourcePodTemplateSpec ¶ added in v0.8.0
type PatchResourcePodTemplateSpec struct {
Spec PatchResourcePodSpec `json:"spec,omitempty"`
}
type PatchResourceSpec ¶ added in v0.8.0
type PatchResourceSpec struct {
Template PatchResourcePodTemplateSpec `json:"template"`
}
type ResourceRecommender ¶
type ResourceRecommender struct { base.BaseRecommender CpuSampleInterval string CpuRequestPercentile string CpuRequestMarginFraction string CpuTargetUtilization string CpuModelHistoryLength string MemSampleInterval string MemPercentile string MemMarginFraction string MemTargetUtilization string MemHistoryLength string OOMProtection bool OOMHistoryLength time.Duration OOMBumpRatio float64 Specification bool SpecificationConfigs []Specification CpuHistogramBucketSize string CpuHistogramMaxValue string MemHistogramBucketSize string MemHistogramMaxValue string }
func (*ResourceRecommender) CheckDataProviders ¶
func (rr *ResourceRecommender) CheckDataProviders(ctx *framework.RecommendationContext) error
CheckDataProviders in PrePrepare phase, will create data source provider via your recommendation config.
func (*ResourceRecommender) CollectData ¶
func (rr *ResourceRecommender) CollectData(ctx *framework.RecommendationContext) error
func (*ResourceRecommender) Filter ¶
func (rr *ResourceRecommender) Filter(ctx *framework.RecommendationContext) error
Filter out k8s resources that are not supported by the recommender.
func (*ResourceRecommender) MemoryOOMProtection ¶ added in v0.9.0
func (*ResourceRecommender) Name ¶
func (rr *ResourceRecommender) Name() string
func (*ResourceRecommender) Observe ¶
func (rr *ResourceRecommender) Observe(ctx *framework.RecommendationContext) error
Observe enhance the observability.
func (*ResourceRecommender) Policy ¶
func (rr *ResourceRecommender) Policy(ctx *framework.RecommendationContext) error
Policy add some logic for result of recommend phase.
func (*ResourceRecommender) PostProcessing ¶
func (rr *ResourceRecommender) PostProcessing(ctx *framework.RecommendationContext) error
func (*ResourceRecommender) PreRecommend ¶
func (rr *ResourceRecommender) PreRecommend(ctx *framework.RecommendationContext) error
func (*ResourceRecommender) Recommend ¶
func (rr *ResourceRecommender) Recommend(ctx *framework.RecommendationContext) error
type Specification ¶ added in v0.9.0
func GetResourceSpecifications ¶ added in v0.9.0
func GetResourceSpecifications(s string) ([]Specification, error)
Click to show internal directories.
Click to hide internal directories.