Documentation ¶
Index ¶
- Constants
- func CreateLocalClient(s *config.Config, stopCh <-chan struct{}, silentWatch bool) (*memclient.LocalClient, error)
- func InitFlags(flagset *pflag.FlagSet)
- func NewControllerManagerCommand(controllers map[string]InitFunc) *cobra.Command
- type ClientBuilder
- type Context
- type InitFunc
- type SimpleControllerClientBuilder
- func (b SimpleControllerClientBuilder) CarbonClient(name string) (carbonclientset.Interface, error)
- func (b SimpleControllerClientBuilder) CarbonClientOrDie(name string) carbonclientset.Interface
- func (b SimpleControllerClientBuilder) Client(name string) (clientset.Interface, error)
- func (b SimpleControllerClientBuilder) ClientOrDie(name string) clientset.Interface
- func (b SimpleControllerClientBuilder) Config(name string) (*restclient.Config, error)
- func (b SimpleControllerClientBuilder) ConfigOrDie(name string) *restclient.Config
- func (b SimpleControllerClientBuilder) DynamicClient(name string) (dynamic.Interface, error)
- func (b SimpleControllerClientBuilder) DynamicClientOrDie(name string) dynamic.Interface
Constants ¶
const ( // ControllerManagerUserAgent is the userAgent name when starting controller managers. ControllerManagerUserAgent = "c2-scheduler" // AllNamespace express all name space AllNamespace = "all-namespaces" // EmptyNamespace express not set namespace EmptyNamespace = "" // MemKubeCheckerName MemKubeCheckerName MemKubeCheckerName = "memkube-config-checker" )
const (
//MemkubeRegisterPrefix memkube service node register prefix
MemkubeRegisterPrefix = "memkube:register:v1"
)
Variables ¶
This section is empty.
Functions ¶
func CreateLocalClient ¶
func CreateLocalClient(s *config.Config, stopCh <-chan struct{}, silentWatch bool) (*memclient.LocalClient, error)
CreateLocalClient create a mem-kube local client.
Types ¶
type ClientBuilder ¶
type ClientBuilder interface { Client(name string) (clientset.Interface, error) ClientOrDie(name string) clientset.Interface CarbonClient(name string) (carbonclientset.Interface, error) CarbonClientOrDie(name string) carbonclientset.Interface DynamicClient(name string) (dynamic.Interface, error) DynamicClientOrDie(name string) dynamic.Interface }
ClientBuilder allows you to get clients and configs for controllers
type Context ¶
type Context struct { // ClientBuilder will provide a client for this controller to use ClientBuilder ClientBuilder KubeClient clientset.Interface CarbonClient carbonclientset.Interface DynamicClient dynamic.Interface // InformerFactory gives access to informers for the controller. InformerFactory informers.SharedInformerFactory ConfigInformerFactory informers.SharedInformerFactory SystemInformerFactory informers.SharedInformerFactory // CarbonInformerFactory gives access to carbon informers for the controller. CarbonInformerFactory carboninformers.SharedInformerFactory // Stop is the stop channel Stop <-chan struct{} Waiter *sync.WaitGroup // 某些controller需要等到manager完全运行起来之后才能开始,InformersStarted 作为通知通道 // 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{} // DeferredDiscoveryRESTMapper is a RESTMapper that will defer // initialization of the RESTMapper until the first mapping is // requested. RESTMapper *restmapper.DeferredDiscoveryRESTMapper Controllers []string // LabelSelector and Namespace defines the scope of the controller LabelSelector string Namespace string Cluster string ConcurrentSyncs int32 //ExtendConfig define the external config file path for controllers ExtendConfig string // delay duration before controllers start after became to leader DelayStart metav1.Duration LocalClient *memclient.LocalClient WriteLabels map[string]string // contains filtered or unexported fields }
Context define the context of controller
type InitFunc ¶
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.
type SimpleControllerClientBuilder ¶
type SimpleControllerClientBuilder struct { ClientConfig *restclient.Config // contains filtered or unexported fields }
SimpleControllerClientBuilder returns a fixed client with different user agents
func (SimpleControllerClientBuilder) CarbonClient ¶
func (b SimpleControllerClientBuilder) CarbonClient(name string) (carbonclientset.Interface, error)
CarbonClient build a client or die
func (SimpleControllerClientBuilder) CarbonClientOrDie ¶
func (b SimpleControllerClientBuilder) CarbonClientOrDie(name string) carbonclientset.Interface
CarbonClientOrDie build a client or die
func (SimpleControllerClientBuilder) Client ¶
func (b SimpleControllerClientBuilder) Client(name string) (clientset.Interface, error)
Client build a client
func (SimpleControllerClientBuilder) ClientOrDie ¶
func (b SimpleControllerClientBuilder) ClientOrDie(name string) clientset.Interface
ClientOrDie build a client or die
func (SimpleControllerClientBuilder) Config ¶
func (b SimpleControllerClientBuilder) Config(name string) (*restclient.Config, error)
Config set the config
func (SimpleControllerClientBuilder) ConfigOrDie ¶
func (b SimpleControllerClientBuilder) ConfigOrDie(name string) *restclient.Config
ConfigOrDie set the config or die
func (SimpleControllerClientBuilder) DynamicClient ¶
func (b SimpleControllerClientBuilder) DynamicClient(name string) (dynamic.Interface, error)
DynamicClient build a dynamic client
func (SimpleControllerClientBuilder) DynamicClientOrDie ¶
func (b SimpleControllerClientBuilder) DynamicClientOrDie(name string) dynamic.Interface
DynamicClientOrDie build a dynamic client or die