controller

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FinalizerName                = "finalizers.consul.hashicorp.com"
	ConsulAgentError             = "ConsulAgentError"
	ExternallyManagedConfigError = "ExternallyManagedConfigError"
	MigrationFailedError         = "MigrationFailedError"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigEntryController

type ConfigEntryController struct {
	ConsulClient *capi.Client

	// DatacenterName indicates the Consul Datacenter name the controller is
	// operating in. Adds this value as metadata on managed resources.
	DatacenterName string

	// EnableConsulNamespaces indicates that a user is running Consul Enterprise
	// with version 1.7+ which supports namespaces.
	EnableConsulNamespaces bool

	// ConsulDestinationNamespace is the name of the Consul namespace to create
	// all config entries in. If EnableNSMirroring is true this is ignored.
	ConsulDestinationNamespace string

	// EnableNSMirroring causes Consul namespaces to be created to match the
	// k8s namespace of any config entry custom resource. Config entries will
	// be created in the matching Consul namespace.
	EnableNSMirroring bool

	// NSMirroringPrefix is an optional prefix that can be added to the Consul
	// namespaces created while mirroring. For example, if it is set to "k8s-",
	// then the k8s `default` namespace will be mirrored in Consul's
	// `k8s-default` namespace.
	NSMirroringPrefix string

	// CrossNSACLPolicy is the name of the ACL policy to attach to
	// any created Consul namespaces to allow cross namespace service discovery.
	// Only necessary if ACLs are enabled.
	CrossNSACLPolicy string
}

ConfigEntryController is a generic controller that is used to reconcile all config entry types, e.g. ServiceDefaults, ServiceResolver, etc, since they share the same reconcile behaviour.

func (*ConfigEntryController) ReconcileEntry

func (r *ConfigEntryController) ReconcileEntry(ctx context.Context, crdCtrl Controller, req ctrl.Request, configEntry common.ConfigEntryResource) (ctrl.Result, error)

ReconcileEntry reconciles an update to a resource. CRD-specific controller's call this function because it handles reconciliation of config entries generically. CRD-specific controller should pass themselves in as updater since we need to call back into their own update methods to ensure they update their internal state.

type Controller

type Controller interface {
	// Update updates the state of the whole object.
	Update(context.Context, client.Object, ...client.UpdateOption) error
	// UpdateStatus updates the state of just the object's status.
	UpdateStatus(context.Context, client.Object, ...client.UpdateOption) error
	// Get retrieves an obj for the given object key from the Kubernetes Cluster.
	// obj must be a struct pointer so that obj can be updated with the response
	// returned by the Server.
	Get(ctx context.Context, key client.ObjectKey, obj client.Object) error
	// Logger returns a logger with values added for the specific controller
	// and request name.
	Logger(types.NamespacedName) logr.Logger
}

Controller is implemented by CRD-specific controllers. It is used by ConfigEntryController to abstract CRD-specific controllers.

type IngressGatewayController added in v0.22.0

type IngressGatewayController struct {
	client.Client
	Log                   logr.Logger
	Scheme                *runtime.Scheme
	ConfigEntryController *ConfigEntryController
}

IngressGatewayController is the controller for IngressGateway resources.

func (*IngressGatewayController) Logger added in v0.22.0

func (*IngressGatewayController) Reconcile added in v0.22.0

func (*IngressGatewayController) SetupWithManager added in v0.22.0

func (r *IngressGatewayController) SetupWithManager(mgr ctrl.Manager) error

func (*IngressGatewayController) UpdateStatus added in v0.22.0

func (r *IngressGatewayController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error

type MeshController added in v0.26.0

type MeshController struct {
	client.Client
	Log                   logr.Logger
	Scheme                *runtime.Scheme
	ConfigEntryController *ConfigEntryController
}

MeshController reconciles a Mesh object

func (*MeshController) Logger added in v0.26.0

func (r *MeshController) Logger(name types.NamespacedName) logr.Logger

func (*MeshController) Reconcile added in v0.26.0

func (r *MeshController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*MeshController) SetupWithManager added in v0.26.0

func (r *MeshController) SetupWithManager(mgr ctrl.Manager) error

func (*MeshController) UpdateStatus added in v0.26.0

func (r *MeshController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error

type ProxyDefaultsController

type ProxyDefaultsController struct {
	client.Client
	Log                   logr.Logger
	Scheme                *runtime.Scheme
	ConfigEntryController *ConfigEntryController
}

ProxyDefaultsController reconciles a ProxyDefaults object

func (*ProxyDefaultsController) Logger

func (*ProxyDefaultsController) Reconcile

func (r *ProxyDefaultsController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*ProxyDefaultsController) SetupWithManager

func (r *ProxyDefaultsController) SetupWithManager(mgr ctrl.Manager) error

func (*ProxyDefaultsController) UpdateStatus

func (r *ProxyDefaultsController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error

type ServiceDefaultsController

type ServiceDefaultsController struct {
	client.Client
	Log                   logr.Logger
	Scheme                *runtime.Scheme
	ConfigEntryController *ConfigEntryController
}

ServiceDefaultsController is the controller for ServiceDefaults resources.

func (*ServiceDefaultsController) Logger

func (*ServiceDefaultsController) Reconcile

func (*ServiceDefaultsController) SetupWithManager

func (r *ServiceDefaultsController) SetupWithManager(mgr ctrl.Manager) error

func (*ServiceDefaultsController) UpdateStatus

func (r *ServiceDefaultsController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error

type ServiceIntentionsController

type ServiceIntentionsController struct {
	client.Client
	Log                   logr.Logger
	Scheme                *runtime.Scheme
	ConfigEntryController *ConfigEntryController
}

ServiceIntentionsController reconciles a ServiceIntentions object

func (*ServiceIntentionsController) Logger

func (*ServiceIntentionsController) Reconcile

func (*ServiceIntentionsController) SetupWithManager

func (r *ServiceIntentionsController) SetupWithManager(mgr ctrl.Manager) error

func (*ServiceIntentionsController) UpdateStatus

func (r *ServiceIntentionsController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error

type ServiceResolverController

type ServiceResolverController struct {
	client.Client
	Log                   logr.Logger
	Scheme                *runtime.Scheme
	ConfigEntryController *ConfigEntryController
}

ServiceResolverController is the controller for ServiceResolver resources.

func (*ServiceResolverController) Logger

func (*ServiceResolverController) Reconcile

func (*ServiceResolverController) SetupWithManager

func (r *ServiceResolverController) SetupWithManager(mgr ctrl.Manager) error

func (*ServiceResolverController) UpdateStatus

func (r *ServiceResolverController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error

type ServiceRouterController

type ServiceRouterController struct {
	client.Client
	Log                   logr.Logger
	Scheme                *runtime.Scheme
	ConfigEntryController *ConfigEntryController
}

ServiceRouterController is the controller for ServiceRouter resources.

func (*ServiceRouterController) Logger

func (*ServiceRouterController) Reconcile

func (r *ServiceRouterController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*ServiceRouterController) SetupWithManager

func (r *ServiceRouterController) SetupWithManager(mgr ctrl.Manager) error

func (*ServiceRouterController) UpdateStatus

func (r *ServiceRouterController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error

type ServiceSplitterController

type ServiceSplitterController struct {
	client.Client
	Log                   logr.Logger
	Scheme                *runtime.Scheme
	ConfigEntryController *ConfigEntryController
}

ServiceSplitterReconciler reconciles a ServiceSplitter object

func (*ServiceSplitterController) Logger

func (*ServiceSplitterController) Reconcile

func (*ServiceSplitterController) SetupWithManager

func (r *ServiceSplitterController) SetupWithManager(mgr ctrl.Manager) error

func (*ServiceSplitterController) UpdateStatus

func (r *ServiceSplitterController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error

type TerminatingGatewayController added in v0.22.0

type TerminatingGatewayController struct {
	client.Client
	Log                   logr.Logger
	Scheme                *runtime.Scheme
	ConfigEntryController *ConfigEntryController
}

TerminatingGatewayController is the controller for TerminatingGateway resources.

func (*TerminatingGatewayController) Logger added in v0.22.0

func (*TerminatingGatewayController) Reconcile added in v0.22.0

func (*TerminatingGatewayController) SetupWithManager added in v0.22.0

func (r *TerminatingGatewayController) SetupWithManager(mgr ctrl.Manager) error

func (*TerminatingGatewayController) UpdateStatus added in v0.22.0

Jump to

Keyboard shortcuts

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