...

Package app

import "k8s.io/kubernetes/cmd/kube-controller-manager/app"
Overview
Index
Subdirectories

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.

Package app implements a server that runs a set of active components. This includes replication controllers, service endpoints and nodes.

Index ▾

Constants
func AttemptToLoadRecycler(path string, config *volume.VolumeConfig) error
func ControllerAliases() map[string]string
func ControllersDisabledByDefault() []string
func GetDynamicPluginProber(config persistentvolumeconfig.VolumeConfiguration) volume.DynamicPluginProber
func KnownControllers() []string
func NewControllerDescriptors() map[string]*ControllerDescriptor
func NewControllerManagerCommand() *cobra.Command
func ProbeAttachableVolumePlugins(logger klog.Logger) ([]volume.VolumePlugin, error)
func ProbeControllerVolumePlugins(logger klog.Logger, config persistentvolumeconfig.VolumeConfiguration) ([]volume.VolumePlugin, error)
func ProbeExpandableVolumePlugins(logger klog.Logger, config persistentvolumeconfig.VolumeConfiguration) ([]volume.VolumePlugin, error)
func ResyncPeriod(c *config.CompletedConfig) func() time.Duration
func Run(ctx context.Context, c *config.CompletedConfig) error
func StartController(ctx context.Context, controllerCtx ControllerContext, controllerDescriptor *ControllerDescriptor, unsecuredMux *mux.PathRecorderMux) (healthz.HealthChecker, error)
func StartControllers(ctx context.Context, controllerCtx ControllerContext, controllerDescriptors map[string]*ControllerDescriptor, unsecuredMux *mux.PathRecorderMux, healthzHandler *controllerhealthz.MutableHealthzHandler) error
type ControllerContext
    func CreateControllerContext(ctx context.Context, s *config.CompletedConfig, rootClientBuilder, clientBuilder clientbuilder.ControllerClientBuilder) (ControllerContext, error)
    func (c ControllerContext) IsControllerEnabled(controllerDescriptor *ControllerDescriptor) bool
type ControllerDescriptor
    func (r *ControllerDescriptor) GetAliases() []string
    func (r *ControllerDescriptor) GetInitFunc() InitFunc
    func (r *ControllerDescriptor) GetRequiredFeatureGates() []featuregate.Feature
    func (r *ControllerDescriptor) IsCloudProviderController() bool
    func (r *ControllerDescriptor) IsDisabledByDefault() bool
    func (r *ControllerDescriptor) Name() string
    func (r *ControllerDescriptor) RequiresSpecialHandling() bool
type ControllerLoopMode
type InitFunc

Package files

apps.go autoscaling.go batch.go bootstrap.go certificates.go cloudproviders.go controllermanager.go core.go discovery.go flags_providers.go import_known_versions.go networking.go plugins.go plugins_providers.go policy.go rbac.go storageversionmigrator.go validatingadmissionpolicystatus.go

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"
)

func AttemptToLoadRecycler

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 ControllerAliases

func ControllerAliases() map[string]string

ControllerAliases returns a mapping of aliases to canonical controller names

func ControllersDisabledByDefault

func ControllersDisabledByDefault() []string

func GetDynamicPluginProber

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

func KnownControllers() []string

KnownControllers returns all known controllers's name

func NewControllerDescriptors

func NewControllerDescriptors() map[string]*ControllerDescriptor

NewControllerDescriptors is a public map of named controller groups (you can start more than one in an init func) paired to their ControllerDescriptor wrapper object that includes InitFunc. This allows for structured downstream composition and subdivision.

func NewControllerManagerCommand

func NewControllerManagerCommand() *cobra.Command

NewControllerManagerCommand creates a *cobra.Command object with default parameters

func ProbeAttachableVolumePlugins

func ProbeAttachableVolumePlugins(logger klog.Logger) ([]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

func ProbeControllerVolumePlugins(logger klog.Logger, 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

func ProbeExpandableVolumePlugins(logger klog.Logger, config persistentvolumeconfig.VolumeConfiguration) ([]volume.VolumePlugin, error)

ProbeExpandableVolumePlugins returns volume plugins which are expandable

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(ctx context.Context, c *config.CompletedConfig) error

Run runs the KubeControllerManagerOptions.

func StartController

func StartController(ctx context.Context, controllerCtx ControllerContext, controllerDescriptor *ControllerDescriptor,
    unsecuredMux *mux.PathRecorderMux) (healthz.HealthChecker, error)

StartController starts a controller with a specified ControllerContext and performs required pre- and post- checks/actions

func StartControllers

func StartControllers(ctx context.Context, controllerCtx ControllerContext, controllerDescriptors map[string]*ControllerDescriptor,
    unsecuredMux *mux.PathRecorderMux, healthzHandler *controllerhealthz.MutableHealthzHandler) error

StartControllers starts a set of controllers with a specified ControllerContext

type ControllerContext

ControllerContext defines the context object for controller

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

    // 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

    // 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

    // ControllerManagerMetrics provides a proxy to set controller manager specific metrics.
    ControllerManagerMetrics *controllersmetrics.ControllerManagerMetrics

    // GraphBuilder gives an access to dependencyGraphBuilder which keeps tracks of resources in the cluster
    GraphBuilder *garbagecollector.GraphBuilder
}

func CreateControllerContext

func CreateControllerContext(ctx context.Context, s *config.CompletedConfig, rootClientBuilder, clientBuilder clientbuilder.ControllerClientBuilder) (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(controllerDescriptor *ControllerDescriptor) bool

IsControllerEnabled checks if the context's controllers enabled or not

type ControllerDescriptor

type ControllerDescriptor struct {
    // contains filtered or unexported fields
}

func (*ControllerDescriptor) GetAliases

func (r *ControllerDescriptor) GetAliases() []string

GetAliases returns aliases to ensure backwards compatibility and should never be removed! Only addition of new aliases is allowed, and only when a canonical name is changed (please see CHANGE POLICY of controller names)

func (*ControllerDescriptor) GetInitFunc

func (r *ControllerDescriptor) GetInitFunc() InitFunc

func (*ControllerDescriptor) GetRequiredFeatureGates

func (r *ControllerDescriptor) GetRequiredFeatureGates() []featuregate.Feature

func (*ControllerDescriptor) IsCloudProviderController

func (r *ControllerDescriptor) IsCloudProviderController() bool

func (*ControllerDescriptor) IsDisabledByDefault

func (r *ControllerDescriptor) IsDisabledByDefault() bool

func (*ControllerDescriptor) Name

func (r *ControllerDescriptor) Name() string

func (*ControllerDescriptor) RequiresSpecialHandling

func (r *ControllerDescriptor) RequiresSpecialHandling() bool

RequiresSpecialHandling should return true only in a special non-generic controllers like ServiceAccountTokenController

type ControllerLoopMode

ControllerLoopMode is the kube-controller-manager's mode of running controller loops that are cloud provider dependent

type ControllerLoopMode int
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

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.

type InitFunc func(ctx context.Context, controllerContext ControllerContext, controllerName string) (controller controller.Interface, enabled bool, err error)

Subdirectories

Name Synopsis
..
config
options Package options provides the flags used for the controller manager.
testing