app

package
v1.10.5-lite5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2018 License: Apache-2.0 Imports: 100 Imported by: 0

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.

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

View Source
const (
	// Jitter used when starting controller managers
	ControllerStartJitter = 1.0
)

Variables

View Source
var ControllersDisabledByDefault = sets.NewString(
	"bootstrapsigner",
	"tokencleaner",
)

Functions

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 GetAvailableResources

func GetAvailableResources(clientBuilder controller.ControllerClientBuilder) (map[schema.GroupVersionResource]bool, error)

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

func GetDynamicPluginProber(config componentconfig.VolumeConfiguration) volume.DynamicPluginProber

GetDynamicPluginProber gets the probers of dynamically discoverable plugins for the attach/detach controller. Currently only Flexvolume plugins are dynamically discoverable.

func IsControllerEnabled

func IsControllerEnabled(name string, disabledByDefaultControllers sets.String, controllers ...string) bool

func KnownControllers

func KnownControllers() []string

func NewControllerInitializers

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

func NewControllerManagerCommand() *cobra.Command

NewControllerManagerCommand creates a *cobra.Command object with default parameters

func ProbeAttachableVolumePlugins

func ProbeAttachableVolumePlugins() []volume.VolumePlugin

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(cloud cloudprovider.Interface, config componentconfig.VolumeConfiguration) []volume.VolumePlugin

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(config componentconfig.VolumeConfiguration) []volume.VolumePlugin

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

Run runs the KubeControllerManagerOptions. This should never exit.

func StartControllers

func StartControllers(ctx ControllerContext, startSATokenController InitFunc, controllers map[string]InitFunc) error

Types

type ControllerContext

type ControllerContext struct {
	// ClientBuilder will provide a client for this controller to use
	ClientBuilder controller.ControllerClientBuilder

	// InformerFactory gives access to informers for the controller.
	InformerFactory informers.SharedInformerFactory

	// Options provides access to init options for a given controller
	ComponentConfig componentconfig.KubeControllerManagerConfiguration

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

func CreateControllerContext

func CreateControllerContext(s *config.CompletedConfig, rootClientBuilder, clientBuilder controller.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

type ControllerLoopMode

type ControllerLoopMode int
const (
	IncludeCloudLoops ControllerLoopMode = iota
	ExternalLoops
)

type InitFunc

type InitFunc func(ctx ControllerContext) (bool, 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.

Directories

Path Synopsis
Package options provides the flags used for the controller manager.
Package options provides the flags used for the controller manager.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL