controllers

package
v0.0.0-...-be378e9 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 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 {
	// Reconcile hands a hydrated kubernetes resource to the controller for
	// reconciliation. Any changes made to the resource's status are persisted
	// after Reconcile returns, even if it returns an error.
	Reconcile(context.Context, Object) error
	// Interval returns an interval that the controller should wait before
	// executing another reconciliation loop. If set to zero, will only execute
	// on watch events or the global resync interval.
	Interval() time.Duration
	// For returns a default instantiation of the resource and is injected by
	// data from the API Server at the start of the reconciliation loop.
	For() Object
	// Owns returns a slice of resources that are watched by this resources.
	// Watch events are triggered if owner references are set on the resource.
	Owns() []Object
}

Controller is an interface implemented by kit custom resources.

type GenericController

type GenericController struct {
	Controller
	client.Client
}

GenericController implements controllerruntime.Reconciler and runs a standardized reconciliation workflow against incoming resource watch events.

func (*GenericController) Reconcile

Reconcile executes a control loop for the resource

type GenericControllerManager

type GenericControllerManager struct {
	manager.Manager
}

func (*GenericControllerManager) RegisterControllers

func (m *GenericControllerManager) RegisterControllers(controllers ...Controller) Manager

RegisterControllers registers a set of controllers to the controller manager

func (*GenericControllerManager) RegisterWebhooks

func (m *GenericControllerManager) RegisterWebhooks(webhooks ...Webhook) Manager

RegisterWebhooks registers a set of webhooks to the controller manager

type Manager

type Manager interface {
	manager.Manager
	RegisterControllers(controllers ...Controller) Manager
	RegisterWebhooks(controllers ...Webhook) Manager
}

Manager manages a set of controllers and webhooks.

func NewManagerOrDie

func NewManagerOrDie(config *rest.Config, options controllerruntime.Options) Manager

NewManagerOrDie instantiates a controller manager or panics

type NamedController

type NamedController interface {
	Controller
	// Name returns the name of the controller
	Name() string
}

NamedController allows controllers to optionally implement a Name() function which will be used instead of the reconciled resource's name. This is useful when writing multiple controllers for a single resource type.

type Object

type Object interface {
	client.Object
	StatusConditions() apis.ConditionManager
}

Object provides an abstraction over a kubernetes custom resource with methods necessary to standardize reconciliation behavior in kit.

type Webhook

type Webhook interface {
	webhook.AdmissionHandler
	Path() string
}

Webhook implements both a handler and path and can be attached to a webhook server.

Directories

Path Synopsis
infrastructure

Jump to

Keyboard shortcuts

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