Documentation ¶
Overview ¶
Package app implements a server that runs a set of active components. This includes replication controllers, service endpoints and nodes.
Package app implements a server that runs a set of active components. This includes replication controllers, service endpoints and nodes.
Index ¶
- Constants
- Variables
- func KnownControllers() []string
- func NewControllerInitializers() map[string]InitFunc
- func NewControllerManagerCommand() *cobra.Command
- func PrintFlags(flags *pflag.FlagSet)
- func ResyncPeriod(c *config.CompletedConfig) func() time.Duration
- func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error
- func StartControllers(ctx ControllerContext, controllers map[string]InitFunc, ...) error
- type ControllerContext
- type InitFunc
Constants ¶
const ( // ControllerStartJitter used when starting controller managers ControllerStartJitter = 1.0 YurtControllerManager = "yurt-controller-manager" )
Variables ¶
var ControllersDisabledByDefault = sets.NewString()
ControllersDisabledByDefault represents all of default disabled controller
Functions ¶
func KnownControllers ¶
func KnownControllers() []string
KnownControllers returns all controllers name
func NewControllerInitializers ¶
NewControllerInitializers is a public map of named controller groups (you can start more than one in an init func) paired to their InitFunc. This allows for structured downstream composition and subdivision.
func NewControllerManagerCommand ¶
NewControllerManagerCommand creates a *cobra.Command object with default parameters
func PrintFlags ¶ added in v0.6.0
PrintFlags logs the flags in the flagset
func ResyncPeriod ¶
func ResyncPeriod(c *config.CompletedConfig) func() time.Duration
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 Run ¶
func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error
Run runs the KubeControllerManagerOptions. This should never exit.
func StartControllers ¶
func StartControllers(ctx ControllerContext, controllers map[string]InitFunc, unsecuredMux *mux.PathRecorderMux) error
StartControllers starts all of enabled controllers
Types ¶
type ControllerContext ¶
type ControllerContext struct { // ClientBuilder will provide a client for this controller to use ClientBuilder clientbuilder.ControllerClientBuilder // InformerFactory gives access to informers for the controller. InformerFactory informers.SharedInformerFactory // ComponentConfig provides access to init options for a given controller ComponentConfig yurtctrlmgrconfig.YurtControllerManagerConfiguration // Stop is the stop channel Stop <-chan struct{} // 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 is an context for all controllers
func CreateControllerContext ¶
func CreateControllerContext(s *config.CompletedConfig, rootClientBuilder, clientBuilder clientbuilder.ControllerClientBuilder, stop <-chan struct{}) (ControllerContext, error)
CreateControllerContext creates a context struct containing references to resources needed by the controllers such as the cloud provider and clientBuilder. rootClientBuilder is only used for the shared-informers client and token controller.
func (ControllerContext) IsControllerEnabled ¶
func (c ControllerContext) IsControllerEnabled(name string) bool
IsControllerEnabled used for verifing specified controller is enabled or not
type InitFunc ¶
type InitFunc func(ctx ControllerContext) (debuggingHandler http.Handler, enabled bool, err error)
InitFunc is used to launch a particular controller. It may run additional "should I activate checks". Any error returned will cause the controller process to `Fatal` The bool indicates whether the controller was enabled.