Documentation ¶
Overview ¶
Package controllers is responsible for watching resources and calling notifiers on creation/change/deletion events. Each controller (implementing the Controller interface) watchs for a specific Kubernetes object (ie. deployments).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonController ¶
type CommonController struct { Conf *config.KdnConfig Queue workqueue.RateLimitingInterface Informer cache.SharedIndexInformer Name string ListWatch cache.ListerWatcher ObjType runtime.Object StopCh chan struct{} Notifiers notifiers.Notifier // contains filtered or unexported fields }
CommonController implements the core reusable and generic primitives of a controller, and can be embedded by real controllers.
func (*CommonController) Start ¶
func (c *CommonController) Start(wg *sync.WaitGroup)
Start initialize and launch a controller. The sync.WaitGroup argument is expected to be aknowledged (Done()) at controller termination, when Stop() is called.
func (*CommonController) Stop ¶
func (c *CommonController) Stop()
Stop ends a controller and notify the controller's WaitGroup
type Controller ¶
type Controller interface { Start(wg *sync.WaitGroup) Stop() Init(c *config.KdnConfig, n notifiers.Notifier) Controller }
Controller are started in a persistent goroutine at program launch, and are responsible for watching resources, and for calling notifiers when those resources changes.