Documentation ¶
Overview ¶
Package app implements a server that runs a set of active components. This includes node controllers, service and route controller, and so on.
Index ¶
- Constants
- Variables
- func CreateControllerContext(s *cloudcontrollerconfig.CompletedConfig, ...) (genericcontrollermanager.ControllerContext, error)
- func DefaultControllerInitializers(completedConfig *cloudcontrollerconfig.CompletedConfig, ...) map[string]InitFunc
- func GetAvailableResources(clientBuilder clientbuilder.ControllerClientBuilder) (map[schema.GroupVersionResource]bool, error)
- func KnownControllers(controllerInitializers map[string]InitFunc) []string
- func NewCloudControllerManagerCommand(s *options.CloudControllerManagerOptions, c *cloudcontrollerconfig.Config, ...) *cobra.Command
- func ResyncPeriod(c *cloudcontrollerconfig.CompletedConfig) func() time.Duration
- func Run(c *cloudcontrollerconfig.CompletedConfig, ...) error
- func StartCloudNodeControllerWrapper(completedConfig *cloudcontrollerconfig.CompletedConfig, ...) ...
- type InitFunc
Constants ¶
const ( // ControllerStartJitter is the jitter value used when starting controller managers. ControllerStartJitter = 1.0 // ConfigzName is the name used for register cloud-controller manager /configz, same with GroupName. ConfigzName = "cloudcontrollermanager.config.k8s.io" )
const ( // IPv6DualStack enables ipv6 dual stack feature // Original copy from pkg/features/kube_features.go IPv6DualStack = "IPv6DualStack" )
Variables ¶
var ControllersDisabledByDefault = sets.NewString()
ControllersDisabledByDefault is the controller disabled default when starting cloud-controller managers.
Functions ¶
func CreateControllerContext ¶
func CreateControllerContext(s *cloudcontrollerconfig.CompletedConfig, clientBuilder clientbuilder.ControllerClientBuilder, stop <-chan struct{}) (genericcontrollermanager.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 DefaultControllerInitializers ¶
func DefaultControllerInitializers(completedConfig *cloudcontrollerconfig.CompletedConfig, cloud cloudprovider.Interface) map[string]InitFunc
DefaultControllerInitializers is a private 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 GetAvailableResources ¶
func GetAvailableResources(clientBuilder clientbuilder.ControllerClientBuilder) (map[schema.GroupVersionResource]bool, error)
GetAvailableResources gets the map which contains all available resources of the apiserver TODO: In general, any controller checking this needs to be dynamic so users don't have to restart their controller manager if they change the apiserver. Until we get there, the structure here needs to be exposed for the construction of a proper ControllerContext.
func KnownControllers ¶
KnownControllers indicate the default controller we are known.
func NewCloudControllerManagerCommand ¶
func NewCloudControllerManagerCommand(s *options.CloudControllerManagerOptions, c *cloudcontrollerconfig.Config, controllerInitializers map[string]InitFunc) *cobra.Command
NewCloudControllerManagerCommand creates a *cobra.Command object with default parameters
func ResyncPeriod ¶
func ResyncPeriod(c *cloudcontrollerconfig.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 *cloudcontrollerconfig.CompletedConfig, controllerInitializers map[string]InitFunc, stopCh <-chan struct{}) error
Run runs the ExternalCMServer. This should never exit.
func StartCloudNodeControllerWrapper ¶
func StartCloudNodeControllerWrapper(completedConfig *cloudcontrollerconfig.CompletedConfig, cloud cloudprovider.Interface) func(ctx genericcontrollermanager.ControllerContext) (http.Handler, bool, error)
StartCloudNodeControllerWrapper is used to take cloud cofig as input and start cloud node controller
Types ¶
type InitFunc ¶
type InitFunc func(ctx genericcontrollermanager.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.