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 ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
*controller.Base
// contains filtered or unexported fields
}
Controller tracks revisions and notifies a RevisionSynchronizer of their presence and absence.
func NewController ¶
func NewController( opts *controller.Options, revSynch RevisionSynchronizer, informerResyncInterval time.Duration) *Controller
NewController creates an autoscaling Controller.
func (*Controller) Reconcile ¶
func (c *Controller) Reconcile(revKey string) error
Reconcile notifies the RevisionSynchronizer of the presence or absence.
func (*Controller) Run ¶
func (c *Controller) Run(numThreads int, stopCh <-chan struct{}) error
Run starts the Controller monitoring revisions. The Controller uses numThreads goroutines for monitoring and blocks until stopCh is closed, at which point it terminates gracefully and returns.
type RevisionSynchronizer ¶
type RevisionSynchronizer interface {
// OnPresent is called when the given revision exists.
OnPresent(rev *v1alpha1.Revision, logger *zap.SugaredLogger)
// OnAbsent is called when a revision in the given namespace with the given name ceases to exist.
OnAbsent(namespace string, name string, logger *zap.SugaredLogger)
}
RevisionSynchronizer is an interface for notifying the presence or absence of revisions.
Click to show internal directories.
Click to hide internal directories.