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
type StateInfo ¶
type StateInfo struct {
Policies map[string]*PolicyInfo `json:"policies"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.