control

package
v0.0.0-...-f243925 Latest Latest
Warning

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

Go to latest
Published: May 24, 2018 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SuccessSynced is used as part of the Event 'reason' when a ScalingPolicy is synced
	SuccessSynced = "Synced"
	// ErrResourceExists is used as part of the Event 'reason' when a ScalingPolicy fails
	// to sync due to a Deployment of the same name already existing.
	ErrResourceExists = "ErrResourceExists"

	// MessageResourceExists is the message used for Events when a resource
	// fails to sync due to a Deployment already existing
	MessageResourceExists = "Resource %q already exists and is not managed by ScalingPolicy"
	// MessageResourceSynced is the message used for an Event fired when a ScalingPolicy
	// is synced successfully
	MessageResourceSynced = "ScalingPolicy synced successfully"
)

Variables

This section is empty.

Functions

func RunSimulation

func RunSimulation(policy *scalingpolicy.ScalingPolicy, options *options.AutoScalerConfig) (*simulate.Run, error)

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller is the controller implementation for ScalingPolicy resources

func NewController

func NewController(
	state *State,
	kubeClient kubernetes.Interface,
	scalerClient clientset.Interface,
	kubeInformerFactory kubeinformers.SharedInformerFactory,
	scalerInformerFactory informers.SharedInformerFactory) (*Controller, error)

NewController returns a new controller for scaling parent

func (*Controller) Run

func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.

type PolicyInfo

type PolicyInfo struct {
	Policy *scalingpolicy.ScalingPolicy `json:"policy"`
	State  *http.Info                   `json:"state"`
}

type PolicyState

type PolicyState struct {
	// contains filtered or unexported fields
}

PolicyState is the state around a single scaling policy

func NewPolicyState

func NewPolicyState(parent *State, policy *scalingpolicy.ScalingPolicy) *PolicyState

func (*PolicyState) ListGraphs

func (s *PolicyState) ListGraphs() ([]*graph.Metadata, error)

func (*PolicyState) ListSimulations

func (s *PolicyState) ListSimulations() ([]*simulate.Metadata, error)

func (*PolicyState) Query

func (s *PolicyState) Query() *PolicyInfo

type State

type State struct {
	// contains filtered or unexported fields
}

State holds the current parent and state around applying them

func NewState

func NewState(clock clock.Clock, target target.Interface, options *options.AutoScalerConfig) (*State, error)

func (*State) ListGraphs

func (c *State) ListGraphs() ([]*graph.Metadata, error)

func (*State) ListSimulations

func (c *State) ListSimulations() ([]*simulate.Metadata, error)

func (*State) Query

func (c *State) Query() interface{}

Query returns the current state, for reporting e.g. via the /statz endpoint

func (*State) Run

func (c *State) Run(stopCh <-chan struct{})

type StateInfo

type StateInfo struct {
	Policies map[string]*PolicyInfo `json:"policies"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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