Documentation ¶
Overview ¶
Package autoscaling implements a kubernetes controller which tracks revisions and notifies a callback interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewController ¶
func NewController( opts *reconciler.Options, kpaInformer informers.PodAutoscalerInformer, endpointsInformer corev1informers.EndpointsInformer, kpaMetrics KPAMetrics, kpaScaler KPAScaler, ) *controller.Impl
NewController creates an autoscaling Controller.
Types ¶
type KPAMetrics ¶
type KPAMetrics interface { // Get accesses the Metric resource for this key, returning any errors. Get(ctx context.Context, key string) (*autoscaler.Metric, error) // Create adds a Metric resource for a given key, returning any errors. Create(ctx context.Context, kpa *kpa.PodAutoscaler) (*autoscaler.Metric, error) // Delete removes the Metric resource for a given key, returning any errors. Delete(ctx context.Context, key string) error // Watch registers a function to call when Metrics change. Watch(watcher func(string)) }
KPAMetrics is an interface for notifying the presence or absence of KPAs.
type KPAScaler ¶
type KPAScaler interface { // Scale attempts to scale the given KPA's target to the desired scale. Scale(ctx context.Context, kpa *kpa.PodAutoscaler, desiredScale int32) error }
KPAScaler knows how to scale the targets of KPAs
func NewKPAScaler ¶
func NewKPAScaler(servingClientSet clientset.Interface, scaleClientSet scale.ScalesGetter, logger *zap.SugaredLogger, configMapWatcher configmap.Watcher) KPAScaler
NewKPAScaler creates a kpaScaler.
type Reconciler ¶
type Reconciler struct { *reconciler.Base // contains filtered or unexported fields }
Reconciler tracks KPAs and right sizes the ScaleTargetRef based on the information from KPAMetrics.
func (*Reconciler) EnqueueEndpointsKPA ¶
func (c *Reconciler) EnqueueEndpointsKPA(impl *controller.Impl) func(obj interface{})
Click to show internal directories.
Click to hide internal directories.