autoscaling

package
v0.0.0-...-3607bf1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2018 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

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