Documentation ¶
Index ¶
- Constants
- Variables
- func IsControllerEnabled(name string, disabledByDefaultControllers sets.String, controllers []string) bool
- func NewControllerInitializers() map[string]InitFunc
- func NewControllerManagerCommand() *cli.App
- func ResyncPeriod(c *config.Config) func() time.Duration
- func Run(c *config.Config, stopCh <-chan struct{}) error
- func StartControllers(ctx context.Context, controllerCtx ControllerContext, ...) error
- type ControllerContext
- type ControllerInitializersFunc
- type InitFunc
Constants ¶
const (
// ControllerStartJitter is the Jitter used when starting controller managers
ControllerStartJitter = 1.0
)
Variables ¶
var ControllersDisabledByDefault = sets.NewString()
ControllersDisabledByDefault is the set of controllers which is disabled by default
Functions ¶
func IsControllerEnabled ¶
func IsControllerEnabled(name string, disabledByDefaultControllers sets.String, controllers []string) bool
IsControllerEnabled check if a specified controller enabled or not.
func NewControllerManagerCommand ¶
func NewControllerManagerCommand() *cli.App
func ResyncPeriod ¶
ResyncPeriod returns a function which generates a duration each time it is invoked; this is so that multiple controllers don't get into lock-step and all hammer the apiserver with list requests simultaneously.
func StartControllers ¶
Types ¶
type ControllerContext ¶
type ControllerContext struct { // InformerFactory gives access to informers for the controller. InformerFactory informers.SharedInformerFactory // ComponentConfig provides access to init options for a given controller ComponentConfig *config.Config // AvailableResources is a map listing currently available resources AvailableResources map[schema.GroupVersionResource]bool // InformersStarted is closed after all of the controllers have been initialized and are running. After this point it is safe, // for an individual controller to start the shared informers. Before it is closed, they should not. InformersStarted chan struct{} // ResyncPeriod generates a duration each time it is invoked; this is so that // multiple controllers don't get into lock-step and all hammer the apiserver // with list requests simultaneously. ResyncPeriod func() time.Duration }
ControllerContext defines the context object for controller
func CreateControllerContext ¶
func CreateControllerContext(c *config.Config, _ <-chan struct{}) (ControllerContext, error)
func (ControllerContext) IsControllerEnabled ¶
func (c ControllerContext) IsControllerEnabled(name string) bool
type ControllerInitializersFunc ¶
ControllerInitializersFunc is used to create a collection of initializers
given the loopMode.
type InitFunc ¶
type InitFunc func(ctx context.Context, controllerCtx ControllerContext) (controller controller.Interface, enabled bool, err error)
InitFunc is used to launch a particular controller. It returns a controller that can optionally implement other interfaces so that the controller manager can support the requested features. The returned controller may be nil, which will be considered an anonymous controller that requests no additional features from the controller manager. Any error returned will cause the controller process to `Fatal` The bool indicates whether the controller was enabled.