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