Documentation ¶
Index ¶
- Constants
- func GetCronMetricSpecsForHPA(ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler) []autoscalingv2.MetricSpec
- func RecordMetrics(ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler)
- type EffectiveHPAController
- func (c *EffectiveHPAController) CreateHPA(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, ...) (*autoscalingv2.HorizontalPodAutoscaler, error)
- func (c *EffectiveHPAController) CreatePrediction(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler) (*predictionapi.TimeSeriesPrediction, error)
- func (c *EffectiveHPAController) CreateSubstitute(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, ...) (*autoscalingapi.Substitute, error)
- func (c *EffectiveHPAController) GetHPA(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler) (*autoscalingv2.HorizontalPodAutoscaler, error)
- func (c *EffectiveHPAController) GetHPAMetrics(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, ...) ([]autoscalingv2.MetricSpec, error)
- func (c *EffectiveHPAController) GetPredication(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler) (*predictionapi.TimeSeriesPrediction, error)
- func (c *EffectiveHPAController) NewHPAObject(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, ...) (*autoscalingv2.HorizontalPodAutoscaler, error)
- func (c *EffectiveHPAController) NewPredictionObject(ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler) (*predictionapi.TimeSeriesPrediction, error)
- func (c *EffectiveHPAController) NewSubstituteObject(ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, ...) (*autoscalingapi.Substitute, error)
- func (c *EffectiveHPAController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (c *EffectiveHPAController) ReconcileHPA(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, ...) (*autoscalingv2.HorizontalPodAutoscaler, error)
- func (c *EffectiveHPAController) ReconcilePredication(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler) (*predictionapi.TimeSeriesPrediction, error)
- func (c *EffectiveHPAController) ReconcileSubstitute(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, ...) (*autoscalingapi.Substitute, error)
- func (c *EffectiveHPAController) SetupWithManager(mgr ctrl.Manager) error
- func (c *EffectiveHPAController) UpdateHPAIfNeed(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, ...) (*autoscalingv2.HorizontalPodAutoscaler, error)
- func (c *EffectiveHPAController) UpdatePredictionIfNeed(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, ...) (*predictionapi.TimeSeriesPrediction, error)
- func (c *EffectiveHPAController) UpdateStatus(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, ...)
- func (c *EffectiveHPAController) UpdateSubstituteIfNeed(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, ...) (*autoscalingapi.Substitute, error)
- type EhpaControllerConfig
- type EhpaControllerPropagationConfig
- type HPAObserverController
- type SubstituteController
Constants ¶
View Source
const (
RsyncPeriod = 15 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
func GetCronMetricSpecsForHPA ¶ added in v0.3.0
func GetCronMetricSpecsForHPA(ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler) []autoscalingv2.MetricSpec
GetCronMetricSpecsForHPA return a hpa external metric specs from ehpa cron scale specs, this spec will be injected into hpa One ehpa mapping to one cron metric only, even though there are multiple cron specs
func RecordMetrics ¶
func RecordMetrics(ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler)
Types ¶
type EffectiveHPAController ¶
type EffectiveHPAController struct { client.Client Scheme *runtime.Scheme RestMapper meta.RESTMapper Recorder record.EventRecorder ScaleClient scale.ScalesGetter K8SVersion *version.Version Config EhpaControllerConfig }
EffectiveHPAController is responsible for scaling workload's replica based on EffectiveHorizontalPodAutoscaler spec
func (*EffectiveHPAController) CreateHPA ¶
func (c *EffectiveHPAController) CreateHPA(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, substitute *autoscalingapi.Substitute, tsp *predictionapi.TimeSeriesPrediction) (*autoscalingv2.HorizontalPodAutoscaler, error)
func (*EffectiveHPAController) CreatePrediction ¶
func (c *EffectiveHPAController) CreatePrediction(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler) (*predictionapi.TimeSeriesPrediction, error)
func (*EffectiveHPAController) CreateSubstitute ¶
func (c *EffectiveHPAController) CreateSubstitute(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, scale *autoscalingapiv1.Scale) (*autoscalingapi.Substitute, error)
func (*EffectiveHPAController) GetHPA ¶
func (c *EffectiveHPAController) GetHPA(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler) (*autoscalingv2.HorizontalPodAutoscaler, error)
func (*EffectiveHPAController) GetHPAMetrics ¶
func (c *EffectiveHPAController) GetHPAMetrics(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, tsp *predictionapi.TimeSeriesPrediction) ([]autoscalingv2.MetricSpec, error)
GetHPAMetrics loop metricSpec in EffectiveHorizontalPodAutoscaler and generate metricSpec for HPA
func (*EffectiveHPAController) GetPredication ¶
func (c *EffectiveHPAController) GetPredication(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler) (*predictionapi.TimeSeriesPrediction, error)
func (*EffectiveHPAController) NewHPAObject ¶
func (c *EffectiveHPAController) NewHPAObject(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, substitute *autoscalingapi.Substitute, tsp *predictionapi.TimeSeriesPrediction) (*autoscalingv2.HorizontalPodAutoscaler, error)
func (*EffectiveHPAController) NewPredictionObject ¶
func (c *EffectiveHPAController) NewPredictionObject(ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler) (*predictionapi.TimeSeriesPrediction, error)
func (*EffectiveHPAController) NewSubstituteObject ¶
func (c *EffectiveHPAController) NewSubstituteObject(ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, scale *autoscalingapiv1.Scale) (*autoscalingapi.Substitute, error)
func (*EffectiveHPAController) ReconcileHPA ¶
func (c *EffectiveHPAController) ReconcileHPA(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, substitute *autoscalingapi.Substitute, tsp *predictionapi.TimeSeriesPrediction) (*autoscalingv2.HorizontalPodAutoscaler, error)
func (*EffectiveHPAController) ReconcilePredication ¶
func (c *EffectiveHPAController) ReconcilePredication(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler) (*predictionapi.TimeSeriesPrediction, error)
func (*EffectiveHPAController) ReconcileSubstitute ¶
func (c *EffectiveHPAController) ReconcileSubstitute(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, scale *autoscalingapiv1.Scale) (*autoscalingapi.Substitute, error)
func (*EffectiveHPAController) SetupWithManager ¶
func (c *EffectiveHPAController) SetupWithManager(mgr ctrl.Manager) error
func (*EffectiveHPAController) UpdateHPAIfNeed ¶
func (c *EffectiveHPAController) UpdateHPAIfNeed(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, hpaExist *autoscalingv2.HorizontalPodAutoscaler, substitute *autoscalingapi.Substitute, tsp *predictionapi.TimeSeriesPrediction) (*autoscalingv2.HorizontalPodAutoscaler, error)
func (*EffectiveHPAController) UpdatePredictionIfNeed ¶
func (c *EffectiveHPAController) UpdatePredictionIfNeed(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, predictionExist *predictionapi.TimeSeriesPrediction) (*predictionapi.TimeSeriesPrediction, error)
func (*EffectiveHPAController) UpdateStatus ¶
func (c *EffectiveHPAController) UpdateStatus(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, newStatus *autoscalingapi.EffectiveHorizontalPodAutoscalerStatus)
func (*EffectiveHPAController) UpdateSubstituteIfNeed ¶
func (c *EffectiveHPAController) UpdateSubstituteIfNeed(ctx context.Context, ehpa *autoscalingapi.EffectiveHorizontalPodAutoscaler, substituteExist *autoscalingapi.Substitute, scale *autoscalingapiv1.Scale) (*autoscalingapi.Substitute, error)
type EhpaControllerConfig ¶ added in v0.2.0
type EhpaControllerConfig struct {
PropagationConfig EhpaControllerPropagationConfig
}
type EhpaControllerPropagationConfig ¶ added in v0.2.0
type HPAObserverController ¶ added in v0.4.0
type HPAObserverController struct { client.Client Scheme *runtime.Scheme RestMapper meta.RESTMapper Recorder record.EventRecorder }
HPAObserverController is responsible for observer metrics for hpa
func (*HPAObserverController) SetupWithManager ¶ added in v0.4.0
func (c *HPAObserverController) SetupWithManager(mgr ctrl.Manager) error
type SubstituteController ¶
type SubstituteController struct { client.Client Scheme *runtime.Scheme RestMapper meta.RESTMapper Recorder record.EventRecorder ScaleClient scale.ScalesGetter }
SubstituteController is responsible for sync labelSelector to Substitute
func (*SubstituteController) SetupWithManager ¶
func (c *SubstituteController) SetupWithManager(mgr ctrl.Manager) error
Click to show internal directories.
Click to hide internal directories.