Documentation ¶
Index ¶
- Constants
- type ConfigEntryController
- type ControlPlaneRequestLimitController
- func (r *ControlPlaneRequestLimitController) Logger(name types.NamespacedName) logr.Logger
- func (r *ControlPlaneRequestLimitController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ControlPlaneRequestLimitController) SetupWithManager(mgr ctrl.Manager) error
- func (r *ControlPlaneRequestLimitController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type Controller
- type ExportedServicesController
- func (r *ExportedServicesController) Logger(name types.NamespacedName) logr.Logger
- func (r *ExportedServicesController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ExportedServicesController) SetupWithManager(mgr ctrl.Manager) error
- func (r *ExportedServicesController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type FinalizerPatch
- type FinalizerPatcher
- type IngressGatewayController
- func (r *IngressGatewayController) Logger(name types.NamespacedName) logr.Logger
- func (r *IngressGatewayController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *IngressGatewayController) SetupWithManager(mgr ctrl.Manager) error
- func (r *IngressGatewayController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type JWTProviderController
- func (r *JWTProviderController) Logger(name types.NamespacedName) logr.Logger
- func (r *JWTProviderController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *JWTProviderController) SetupWithManager(mgr ctrl.Manager) error
- func (r *JWTProviderController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type MeshController
- func (r *MeshController) Logger(name types.NamespacedName) logr.Logger
- func (r *MeshController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *MeshController) SetupWithManager(mgr ctrl.Manager) error
- func (r *MeshController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type ProxyDefaultsController
- func (r *ProxyDefaultsController) Logger(name types.NamespacedName) logr.Logger
- func (r *ProxyDefaultsController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ProxyDefaultsController) SetupWithManager(mgr ctrl.Manager) error
- func (r *ProxyDefaultsController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type SamenessGroupController
- func (r *SamenessGroupController) Logger(name types.NamespacedName) logr.Logger
- func (r *SamenessGroupController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *SamenessGroupController) SetupWithManager(mgr ctrl.Manager) error
- func (r *SamenessGroupController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type ServiceDefaultsController
- func (r *ServiceDefaultsController) Logger(name types.NamespacedName) logr.Logger
- func (r *ServiceDefaultsController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ServiceDefaultsController) SetupWithManager(mgr ctrl.Manager) error
- func (r *ServiceDefaultsController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type ServiceIntentionsController
- func (r *ServiceIntentionsController) Logger(name types.NamespacedName) logr.Logger
- func (r *ServiceIntentionsController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ServiceIntentionsController) SetupWithManager(mgr ctrl.Manager) error
- func (r *ServiceIntentionsController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type ServiceResolverController
- func (r *ServiceResolverController) Logger(name types.NamespacedName) logr.Logger
- func (r *ServiceResolverController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ServiceResolverController) SetupWithManager(mgr ctrl.Manager) error
- func (r *ServiceResolverController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type ServiceRouterController
- func (r *ServiceRouterController) Logger(name types.NamespacedName) logr.Logger
- func (r *ServiceRouterController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ServiceRouterController) SetupWithManager(mgr ctrl.Manager) error
- func (r *ServiceRouterController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type ServiceSplitterController
- func (r *ServiceSplitterController) Logger(name types.NamespacedName) logr.Logger
- func (r *ServiceSplitterController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ServiceSplitterController) SetupWithManager(mgr ctrl.Manager) error
- func (r *ServiceSplitterController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type TerminatingGatewayController
- func (r *TerminatingGatewayController) Logger(name types.NamespacedName) logr.Logger
- func (r *TerminatingGatewayController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *TerminatingGatewayController) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error
- func (r *TerminatingGatewayController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- func (r *TerminatingGatewayController) UpdateStatusFailedToSetACLs(ctx context.Context, termGW *consulv1alpha1.TerminatingGateway, err error)
Constants ¶
const ( FinalizerName = "finalizers.consul.hashicorp.com" ConsulAgentError = "ConsulAgentError" ConsulPatchError = "ConsulPatchError" ExternallyManagedConfigError = "ExternallyManagedConfigError" MigrationFailedError = "MigrationFailedError" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigEntryController ¶
type ConfigEntryController struct { // ConsulClientConfig is the config for the Consul API client. ConsulClientConfig *consul.Config // ConsulServerConnMgr is the watcher for the Consul server addresses. ConsulServerConnMgr consul.ServerConnectionManager // 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 ControlPlaneRequestLimitController ¶
type ControlPlaneRequestLimitController struct { client.Client FinalizerPatcher Log logr.Logger Scheme *runtime.Scheme ConfigEntryController *ConfigEntryController }
ControlPlaneRequestLimitController reconciles a ControlPlaneRequestLimit object.
func (*ControlPlaneRequestLimitController) Logger ¶
func (r *ControlPlaneRequestLimitController) Logger(name types.NamespacedName) logr.Logger
func (*ControlPlaneRequestLimitController) SetupWithManager ¶
func (r *ControlPlaneRequestLimitController) SetupWithManager(mgr ctrl.Manager) error
func (*ControlPlaneRequestLimitController) UpdateStatus ¶
func (r *ControlPlaneRequestLimitController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
type Controller ¶
type Controller interface { // AddFinalizersPatch creates a patch with the original finalizers with new ones appended to the end. AddFinalizersPatch(obj client.Object, finalizers ...string) *FinalizerPatch // RemoveFinalizersPatch creates a patch to remove a set of finalizers, while preserving the order. RemoveFinalizersPatch(obj client.Object, finalizers ...string) *FinalizerPatch // Patch patches the object. This should only ever be used for updating the metadata of an object, and not object // spec or status. Updating the spec could have unintended consequences such as defaulting zero values. Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error // UpdateStatus updates the state of just the object's status. UpdateStatus(context.Context, client.Object, ...client.SubResourceUpdateOption) 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, opts ...client.GetOption) 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 configentries. It is used by ConfigEntryController to abstract CRD-specific configentries.
type ExportedServicesController ¶
type ExportedServicesController struct { client.Client FinalizerPatcher Log logr.Logger Scheme *runtime.Scheme ConfigEntryController *ConfigEntryController }
ExportedServicesController reconciles a ExportedServices object.
func (*ExportedServicesController) Logger ¶
func (r *ExportedServicesController) Logger(name types.NamespacedName) logr.Logger
func (*ExportedServicesController) SetupWithManager ¶
func (r *ExportedServicesController) SetupWithManager(mgr ctrl.Manager) error
func (*ExportedServicesController) UpdateStatus ¶
func (r *ExportedServicesController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
type FinalizerPatch ¶
type FinalizerPatch struct {
NewFinalizers []string
}
func (*FinalizerPatch) Data ¶
func (fp *FinalizerPatch) Data(obj client.Object) ([]byte, error)
Data implements client.Patch.
func (*FinalizerPatch) Type ¶
func (fp *FinalizerPatch) Type() types.PatchType
Type implements client.Patch. Since this patch is used for a custom CRD, Kubernetes does not allow the more advanced StrategicMergePatch. Therefore, this patcher will replace the entire list of finalizers with the new list, rather than adding/removing individual entries.
This can result in a small race condition where we could overwrite recently modified finalizers (either modified by a user or another controller process). Before the addition of this finalizer patcher implementation, this race condition still existed, but applied to the entirety of the CRD because we used to update the entire CRD rather than just the finalizer, so this reduces the surface area of the race condition. Generally we should not expect users or other configentries to be touching the finalizers of consul-k8s managed CRDs.
type FinalizerPatcher ¶
type FinalizerPatcher struct{}
func (*FinalizerPatcher) AddFinalizersPatch ¶
func (f *FinalizerPatcher) AddFinalizersPatch(oldObj client.Object, addFinalizers ...string) *FinalizerPatch
func (*FinalizerPatcher) RemoveFinalizersPatch ¶
func (f *FinalizerPatcher) RemoveFinalizersPatch(oldObj client.Object, removeFinalizers ...string) *FinalizerPatch
type IngressGatewayController ¶
type IngressGatewayController struct { FinalizerPatcher client.Client Log logr.Logger Scheme *runtime.Scheme ConfigEntryController *ConfigEntryController }
IngressGatewayController is the controller for IngressGateway resources.
func (*IngressGatewayController) Logger ¶
func (r *IngressGatewayController) Logger(name types.NamespacedName) logr.Logger
func (*IngressGatewayController) SetupWithManager ¶
func (r *IngressGatewayController) SetupWithManager(mgr ctrl.Manager) error
func (*IngressGatewayController) UpdateStatus ¶
func (r *IngressGatewayController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
type JWTProviderController ¶
type JWTProviderController struct { client.Client FinalizerPatcher Log logr.Logger Scheme *runtime.Scheme ConfigEntryController *ConfigEntryController }
JWTProviderController reconciles a JWTProvider object.
func (*JWTProviderController) Logger ¶
func (r *JWTProviderController) Logger(name types.NamespacedName) logr.Logger
func (*JWTProviderController) SetupWithManager ¶
func (r *JWTProviderController) SetupWithManager(mgr ctrl.Manager) error
func (*JWTProviderController) UpdateStatus ¶
func (r *JWTProviderController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
type MeshController ¶
type MeshController struct { client.Client FinalizerPatcher Log logr.Logger Scheme *runtime.Scheme ConfigEntryController *ConfigEntryController }
MeshController reconciles a Mesh object.
func (*MeshController) Logger ¶
func (r *MeshController) Logger(name types.NamespacedName) logr.Logger
func (*MeshController) SetupWithManager ¶
func (r *MeshController) SetupWithManager(mgr ctrl.Manager) error
func (*MeshController) UpdateStatus ¶
func (r *MeshController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
type ProxyDefaultsController ¶
type ProxyDefaultsController struct { client.Client FinalizerPatcher Log logr.Logger Scheme *runtime.Scheme ConfigEntryController *ConfigEntryController }
ProxyDefaultsController reconciles a ProxyDefaults object.
func (*ProxyDefaultsController) Logger ¶
func (r *ProxyDefaultsController) Logger(name types.NamespacedName) logr.Logger
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.SubResourceUpdateOption) error
type SamenessGroupController ¶
type SamenessGroupController struct { client.Client FinalizerPatcher Log logr.Logger Scheme *runtime.Scheme ConfigEntryController *ConfigEntryController }
SamenessGroupController reconciles a SamenessGroups object.
func (*SamenessGroupController) Logger ¶
func (r *SamenessGroupController) Logger(name types.NamespacedName) logr.Logger
func (*SamenessGroupController) SetupWithManager ¶
func (r *SamenessGroupController) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
func (*SamenessGroupController) UpdateStatus ¶
func (r *SamenessGroupController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
type ServiceDefaultsController ¶
type ServiceDefaultsController struct { client.Client FinalizerPatcher Log logr.Logger Scheme *runtime.Scheme ConfigEntryController *ConfigEntryController }
ServiceDefaultsController is the controller for ServiceDefaults resources.
func (*ServiceDefaultsController) Logger ¶
func (r *ServiceDefaultsController) Logger(name types.NamespacedName) logr.Logger
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.SubResourceUpdateOption) error
type ServiceIntentionsController ¶
type ServiceIntentionsController struct { client.Client FinalizerPatcher Log logr.Logger Scheme *runtime.Scheme ConfigEntryController *ConfigEntryController }
ServiceIntentionsController reconciles a ServiceIntentions object.
func (*ServiceIntentionsController) Logger ¶
func (r *ServiceIntentionsController) Logger(name types.NamespacedName) logr.Logger
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.SubResourceUpdateOption) error
type ServiceResolverController ¶
type ServiceResolverController struct { client.Client FinalizerPatcher Log logr.Logger Scheme *runtime.Scheme ConfigEntryController *ConfigEntryController }
ServiceResolverController is the controller for ServiceResolver resources.
func (*ServiceResolverController) Logger ¶
func (r *ServiceResolverController) Logger(name types.NamespacedName) logr.Logger
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.SubResourceUpdateOption) error
type ServiceRouterController ¶
type ServiceRouterController struct { client.Client FinalizerPatcher Log logr.Logger Scheme *runtime.Scheme ConfigEntryController *ConfigEntryController }
ServiceRouterController is the controller for ServiceRouter resources.
func (*ServiceRouterController) Logger ¶
func (r *ServiceRouterController) Logger(name types.NamespacedName) logr.Logger
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.SubResourceUpdateOption) error
type ServiceSplitterController ¶
type ServiceSplitterController struct { client.Client FinalizerPatcher Log logr.Logger Scheme *runtime.Scheme ConfigEntryController *ConfigEntryController }
ServiceSplitterReconciler reconciles a ServiceSplitter object.
func (*ServiceSplitterController) Logger ¶
func (r *ServiceSplitterController) Logger(name types.NamespacedName) logr.Logger
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.SubResourceUpdateOption) error
type TerminatingGatewayController ¶
type TerminatingGatewayController struct { client.Client FinalizerPatcher NamespacesEnabled bool Log logr.Logger Scheme *runtime.Scheme ConfigEntryController *ConfigEntryController }
TerminatingGatewayController is the controller for TerminatingGateway resources.
func (*TerminatingGatewayController) Logger ¶
func (r *TerminatingGatewayController) Logger(name types.NamespacedName) logr.Logger
func (*TerminatingGatewayController) SetupWithManager ¶
func (*TerminatingGatewayController) UpdateStatus ¶
func (r *TerminatingGatewayController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
func (*TerminatingGatewayController) UpdateStatusFailedToSetACLs ¶
func (r *TerminatingGatewayController) UpdateStatusFailedToSetACLs(ctx context.Context, termGW *consulv1alpha1.TerminatingGateway, err error)
Source Files ¶
- configentry_controller.go
- controlplanerequestlimit_controller.go
- exportedservices_controller.go
- finalizer_patch.go
- ingressgateway_controller.go
- jwtprovider_controller.go
- mesh_controller.go
- proxydefaults_controller.go
- samenessgroups_controller.go
- servicedefaults_controller.go
- serviceintentions_controller.go
- serviceresolver_controller.go
- servicerouter_controller.go
- servicesplitter_controller.go
- terminatinggateway_controller.go