Documentation ¶
Index ¶
- func NewReplicasRecommender(recommender apis.Recommender, ...) (recommender.Recommender, error)
- type PatchReplicas
- type PatchReplicasSpec
- type ReplicasRecommender
- func (rr *ReplicasRecommender) CheckDataProviders(ctx *framework.RecommendationContext) error
- func (rr *ReplicasRecommender) CollectData(ctx *framework.RecommendationContext) error
- func (rr *ReplicasRecommender) Filter(ctx *framework.RecommendationContext) error
- func (rr *ReplicasRecommender) GetMinReplicas(ctx *framework.RecommendationContext) (int32, float64, float64, error)
- func (rr *ReplicasRecommender) Name() string
- func (rr *ReplicasRecommender) Observe(ctx *framework.RecommendationContext) error
- func (rr *ReplicasRecommender) Policy(ctx *framework.RecommendationContext) error
- func (rr *ReplicasRecommender) PostProcessing(ctx *framework.RecommendationContext) error
- func (rr *ReplicasRecommender) PreRecommend(ctx *framework.RecommendationContext) error
- func (rr *ReplicasRecommender) ProposeMinReplicas(resourceUsage float64, requestTotal int64, targetUtilization float64) (int32, error)
- func (rr *ReplicasRecommender) Recommend(ctx *framework.RecommendationContext) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewReplicasRecommender ¶
func NewReplicasRecommender(recommender apis.Recommender, recommendationRule analysisv1alph1.RecommendationRule) (recommender.Recommender, error)
NewReplicasRecommender create a new replicas recommender.
Types ¶
type PatchReplicas ¶ added in v0.8.0
type PatchReplicas struct {
Spec PatchReplicasSpec `json:"spec,omitempty"`
}
type PatchReplicasSpec ¶ added in v0.8.0
type PatchReplicasSpec struct {
Replicas *int32 `json:"replicas,omitempty"`
}
type ReplicasRecommender ¶
type ReplicasRecommender struct { base.BaseRecommender WorkloadMinReplicas int64 PodMinReadySeconds int64 PodAvailableRatio float64 CpuPercentile float64 MemPercentile float64 DefaultMinReplicas int64 CPUTargetUtilization float64 MemTargetUtilization float64 }
func (*ReplicasRecommender) CheckDataProviders ¶
func (rr *ReplicasRecommender) CheckDataProviders(ctx *framework.RecommendationContext) error
CheckDataProviders in PrePrepare phase, will create data source provider via your recommendation config.
func (*ReplicasRecommender) CollectData ¶
func (rr *ReplicasRecommender) CollectData(ctx *framework.RecommendationContext) error
func (*ReplicasRecommender) Filter ¶
func (rr *ReplicasRecommender) Filter(ctx *framework.RecommendationContext) error
Filter out k8s resources that are not supported by the recommender.
func (*ReplicasRecommender) GetMinReplicas ¶ added in v0.9.0
func (rr *ReplicasRecommender) GetMinReplicas(ctx *framework.RecommendationContext) (int32, float64, float64, error)
func (*ReplicasRecommender) Name ¶
func (rr *ReplicasRecommender) Name() string
func (*ReplicasRecommender) Observe ¶
func (rr *ReplicasRecommender) Observe(ctx *framework.RecommendationContext) error
Observe enhance the observability.
func (*ReplicasRecommender) Policy ¶
func (rr *ReplicasRecommender) Policy(ctx *framework.RecommendationContext) error
Policy add some logic for result of recommend phase.
func (*ReplicasRecommender) PostProcessing ¶
func (rr *ReplicasRecommender) PostProcessing(ctx *framework.RecommendationContext) error
func (*ReplicasRecommender) PreRecommend ¶
func (rr *ReplicasRecommender) PreRecommend(ctx *framework.RecommendationContext) error
func (*ReplicasRecommender) ProposeMinReplicas ¶
func (rr *ReplicasRecommender) ProposeMinReplicas(resourceUsage float64, requestTotal int64, targetUtilization float64) (int32, error)
ProposeMinReplicas calculate min replicas based on default-min-replicas
func (*ReplicasRecommender) Recommend ¶
func (rr *ReplicasRecommender) Recommend(ctx *framework.RecommendationContext) error
Click to show internal directories.
Click to hide internal directories.