kpa

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2019 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package kpa 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,
	paInformer informers.PodAutoscalerInformer,
	endpointsInformer corev1informers.EndpointsInformer,
	kpaDeciders Deciders,
	kpaScaler KPAScaler,
	dynConfig *autoscaler.DynamicConfig,
) *controller.Impl

NewController creates an autoscaling Controller.

Types

type Deciders added in v0.5.0

type Deciders interface {
	// Get accesses the Decider resource for this key, returning any errors.
	Get(ctx context.Context, namespace, name string) (*autoscaler.Decider, error)

	// Create adds a Decider resource for a given key, returning any errors.
	Create(ctx context.Context, metric *autoscaler.Decider) (*autoscaler.Decider, error)

	// Delete removes the Decider resource for a given key, returning any errors.
	Delete(ctx context.Context, namespace, name string) error

	// Watch registers a function to call when Decider change.
	Watch(watcher func(string))

	// Update update the Decider resource, return the new Decider or any errors.
	Update(ctx context.Context, metric *autoscaler.Decider) (*autoscaler.Decider, error)
}

Deciders is an interface for notifying the presence or absence of KPAs.

type KPAScaler

type KPAScaler interface {
	// Scale attempts to scale the given PA's target to the desired scale.
	Scale(ctx context.Context, pa *pav1alpha1.PodAutoscaler, desiredScale int32) (int32, error)
}

KPAScaler knows how to scale the targets of kpa-class PodAutoscalers.

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 PAs and right sizes the ScaleTargetRef based on the information from Deciders.

func (*Reconciler) Reconcile

func (c *Reconciler) Reconcile(ctx context.Context, key string) error

Reconcile right sizes PA ScaleTargetRefs based on the state of decisions in Deciders.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL