controller

package
v0.0.0-...-4c0bbbd Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	// Run starts running the controller watching for required kubernetes resources
	// and associating required handler with resource events.
	Run(context.Context)
}

Controller is the standard interface which each controller within dgraph operator must implement. List of configured controllers managed by dgraph operator as of now are: * DgraphClusterController

type Manager

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

Manager manages all the controllers for the operator. This is the top level manager for all the underlying controllers and managers. All controllers which operator manages should be in the registered controller list of Manager.

func MustNewControllerManager

func MustNewControllerManager() *Manager

MustNewControllerManager returns a Manager instance if it is able to do so, else it exists the program.

func (*Manager) RunOperatorControllers

func (cm *Manager) RunOperatorControllers() error

RunOperatorControllers runs all the required controllers for dgraph operator. Each controller watches for the resources it reconciles and take necessery action to reach to the desired state of the resource.

Here we also implement the logic of leader election for dgraph operator using built-in leader election capbility in kubernetes. See: https://github.com/kubernetes/client-go/blob/master/examples/leader-election/main.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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