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.
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.
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.
Package app implements a server that runs a set of active components. This includes replication controllers, service endpoints and nodes.
Package app imports the API groups that the client will support TODO: Remove this file when namespace controller and garbage collector stops using legacyscheme.Registry.RESTMapper()
Package app implements a server that runs a set of active components. This includes replication controllers, service endpoints and nodes.
Index ¶
- Constants
- Variables
- func AttemptToLoadRecycler(path string, config *volume.VolumeConfig) error
- func GetAvailableResources(clientBuilder clientbuilder.ControllerClientBuilder) (map[schema.GroupVersionResource]bool, error)
- func GetDynamicPluginProber(config persistentvolumeconfig.VolumeConfiguration) volume.DynamicPluginProber
- func KnownControllers() []string
- func NewControllerInitializers(loopMode ControllerLoopMode) map[string]InitFunc
- func NewControllerManagerCommand() *cobra.Command
- func ProbeAttachableVolumePlugins() ([]volume.VolumePlugin, error)
- func ProbeControllerVolumePlugins(cloud cloudprovider.Interface, ...) ([]volume.VolumePlugin, error)
- func ProbeExpandableVolumePlugins(config persistentvolumeconfig.VolumeConfiguration) ([]volume.VolumePlugin, error)
- func ResyncPeriod(c *config.CompletedConfig) func() time.Duration
- func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error
- func StartControllers(ctx ControllerContext, startSATokenController InitFunc, ...) error
- type ControllerContext
- type ControllerInitializersFunc
- type ControllerLoopMode
- type InitFunc
Constants ¶
const ( // ControllerStartJitter is the Jitter used when starting controller managers ControllerStartJitter = 1.0 // ConfigzName is the name used for register kube-controller manager /configz, same with GroupName. ConfigzName = "kubecontrollermanager.config.k8s.io" )
Variables ¶
var ControllersDisabledByDefault = sets.NewString(
"bootstrapsigner",
"tokencleaner",
)
ControllersDisabledByDefault is the set of controllers which is disabled by default
Functions ¶
func AttemptToLoadRecycler ¶ added in v1.2.0
func AttemptToLoadRecycler(path string, config *volume.VolumeConfig) error
AttemptToLoadRecycler tries decoding a pod from a filepath for use as a recycler for a volume. If successful, this method will set the recycler on the config. If unsuccessful, an error is returned. Function is exported for reuse downstream.
func GetAvailableResources ¶ added in v1.7.0
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 GetDynamicPluginProber ¶ added in v1.8.0
func GetDynamicPluginProber(config persistentvolumeconfig.VolumeConfiguration) volume.DynamicPluginProber
GetDynamicPluginProber gets the probers of dynamically discoverable plugins for the attach/detach controller. Currently only Flexvolume plugins are dynamically discoverable.
func KnownControllers ¶ added in v1.6.0
func KnownControllers() []string
KnownControllers returns all known controllers's name
func NewControllerInitializers ¶ added in v1.7.0
func NewControllerInitializers(loopMode ControllerLoopMode) map[string]InitFunc
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 ¶ added in v1.1.1
NewControllerManagerCommand creates a *cobra.Command object with default parameters
func ProbeAttachableVolumePlugins ¶ added in v1.3.0
func ProbeAttachableVolumePlugins() ([]volume.VolumePlugin, error)
ProbeAttachableVolumePlugins collects all volume plugins for the attach/ detach controller. The list of plugins is manually compiled. This code and the plugin initialization code for kubelet really, really need a through refactor.
func ProbeControllerVolumePlugins ¶ added in v1.4.0
func ProbeControllerVolumePlugins(cloud cloudprovider.Interface, config persistentvolumeconfig.VolumeConfiguration) ([]volume.VolumePlugin, error)
ProbeControllerVolumePlugins collects all persistent volume plugins into an easy to use list. Only volume plugins that implement any of provisioner/recycler/deleter interface should be returned.
func ProbeExpandableVolumePlugins ¶ added in v1.8.0
func ProbeExpandableVolumePlugins(config persistentvolumeconfig.VolumeConfiguration) ([]volume.VolumePlugin, error)
ProbeExpandableVolumePlugins returns volume plugins which are expandable
func ResyncPeriod ¶ added in v1.2.0
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 ¶ added in v1.2.0
func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error
Run runs the KubeControllerManagerOptions. This should never exit.
func StartControllers ¶ added in v1.2.0
func StartControllers(ctx ControllerContext, startSATokenController InitFunc, controllers map[string]InitFunc, unsecuredMux *mux.PathRecorderMux) error
StartControllers starts a set of controllers with a specified ControllerContext
Types ¶
type ControllerContext ¶ added in v1.6.0
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 // ObjectOrMetadataInformerFactory gives access to informers for typed resources // and dynamic resources by their metadata. All generic controllers currently use // object metadata - if a future controller needs access to the full object this // would become GenericInformerFactory and take a dynamic client. ObjectOrMetadataInformerFactory informerfactory.InformerFactory // ComponentConfig provides access to init options for a given controller ComponentConfig kubectrlmgrconfig.KubeControllerManagerConfiguration // DeferredDiscoveryRESTMapper is a RESTMapper that will defer // initialization of the RESTMapper until the first mapping is // requested. RESTMapper *restmapper.DeferredDiscoveryRESTMapper // AvailableResources is a map listing currently available resources AvailableResources map[schema.GroupVersionResource]bool // Cloud is the cloud provider interface for the controllers to use. // It must be initialized and ready to use. Cloud cloudprovider.Interface // Control for which control loops to be run // IncludeCloudLoops is for a kube-controller-manager running all loops // ExternalLoops is for a kube-controller-manager running with a cloud-controller-manager LoopMode ControllerLoopMode // 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 defines the context object for controller
func CreateControllerContext ¶ added in v1.7.0
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 ¶ added in v1.6.0
func (c ControllerContext) IsControllerEnabled(name string) bool
IsControllerEnabled checks if the context's controllers enabled or not
type ControllerInitializersFunc ¶ added in v1.21.0
type ControllerInitializersFunc func(loopMode ControllerLoopMode) (initializers map[string]InitFunc)
ControllerInitializersFunc is used to create a collection of initializers
given the loopMode.
type ControllerLoopMode ¶ added in v1.10.0
type ControllerLoopMode int
ControllerLoopMode is the kube-controller-manager's mode of running controller loops that are cloud provider dependent
const ( // IncludeCloudLoops means the kube-controller-manager include the controller loops that are cloud provider dependent IncludeCloudLoops ControllerLoopMode = iota // ExternalLoops means the kube-controller-manager exclude the controller loops that are cloud provider dependent ExternalLoops )
type InitFunc ¶ added in v1.6.0
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.