Documentation ¶
Index ¶
- Constants
- func RegisterGatewayFieldIndexes(ctx context.Context, mgr ctrl.Manager) error
- type APIGatewayController
- func (r *APIGatewayController) Logger(name types.NamespacedName) logr.Logger
- func (r *APIGatewayController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *APIGatewayController) SetupWithManager(mgr ctrl.Manager) error
- func (r *APIGatewayController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type ConsulResourceController
- 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 GRPCRouteController
- func (r *GRPCRouteController) Logger(name types.NamespacedName) logr.Logger
- func (r *GRPCRouteController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *GRPCRouteController) SetupWithManager(mgr ctrl.Manager) error
- func (r *GRPCRouteController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type GatewayClassConfigController
- func (r *GatewayClassConfigController) Logger(name types.NamespacedName) logr.Logger
- func (r *GatewayClassConfigController) Reconcile(_ context.Context, _ ctrl.Request) (ctrl.Result, error)
- func (r *GatewayClassConfigController) SetupWithManager(mgr ctrl.Manager) error
- func (r *GatewayClassConfigController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type GatewayClassController
- func (r *GatewayClassController) Logger(name types.NamespacedName) logr.Logger
- func (r *GatewayClassController) Reconcile(_ context.Context, _ ctrl.Request) (ctrl.Result, error)
- func (r *GatewayClassController) SetupWithManager(mgr ctrl.Manager) error
- func (r *GatewayClassController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type HTTPRouteController
- func (r *HTTPRouteController) Logger(name types.NamespacedName) logr.Logger
- func (r *HTTPRouteController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *HTTPRouteController) SetupWithManager(mgr ctrl.Manager) error
- func (r *HTTPRouteController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type MeshConfigurationController
- func (r *MeshConfigurationController) Logger(name types.NamespacedName) logr.Logger
- func (r *MeshConfigurationController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *MeshConfigurationController) SetupWithManager(mgr ctrl.Manager) error
- func (r *MeshConfigurationController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type MeshGatewayController
- func (r *MeshGatewayController) Logger(name types.NamespacedName) logr.Logger
- func (r *MeshGatewayController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *MeshGatewayController) SetupWithManager(mgr ctrl.Manager) error
- func (r *MeshGatewayController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type ProxyConfigurationController
- func (r *ProxyConfigurationController) Logger(name types.NamespacedName) logr.Logger
- func (r *ProxyConfigurationController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ProxyConfigurationController) SetupWithManager(mgr ctrl.Manager) error
- func (r *ProxyConfigurationController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type ResourceController
- type TCPRouteController
- func (r *TCPRouteController) Logger(name types.NamespacedName) logr.Logger
- func (r *TCPRouteController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *TCPRouteController) SetupWithManager(mgr ctrl.Manager) error
- func (r *TCPRouteController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
- type TrafficPermissionsController
- func (r *TrafficPermissionsController) Logger(name types.NamespacedName) logr.Logger
- func (r *TrafficPermissionsController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *TrafficPermissionsController) SetupWithManager(mgr ctrl.Manager) error
- func (r *TrafficPermissionsController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
Constants ¶
const ( FinalizerName = "finalizers.consul.hashicorp.com" ConsulAgentError = "ConsulAgentError" ExternallyManagedConfigError = "ExternallyManagedConfigError" )
const ( // Naming convention: TARGET_REFERENCE. GatewayClass_GatewayClassConfigIndex indexName = "__v2_gatewayclass_referencing_gatewayclassconfig" APIGateway_GatewayClassIndex indexName = "__v2_api_gateway_referencing_gatewayclass" MeshGateway_GatewayClassIndex indexName = "__v2_mesh_gateway_referencing_gatewayclass" )
Variables ¶
This section is empty.
Functions ¶
func RegisterGatewayFieldIndexes ¶
RegisterGatewayFieldIndexes registers all of the field indexes for the xGateway controllers. These indexes are similar to indexes used in databases to speed up queries. They allow us to quickly find objects based on a field value.
Types ¶
type APIGatewayController ¶
type APIGatewayController struct { client.Client Log logr.Logger Scheme *runtime.Scheme Controller *ConsulResourceController GatewayConfig gateways.GatewayConfig }
APIGatewayController reconciles a APIGateway object.
func (*APIGatewayController) Logger ¶
func (r *APIGatewayController) Logger(name types.NamespacedName) logr.Logger
func (*APIGatewayController) SetupWithManager ¶
func (r *APIGatewayController) SetupWithManager(mgr ctrl.Manager) error
func (*APIGatewayController) UpdateStatus ¶
func (r *APIGatewayController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
type ConsulResourceController ¶
type ConsulResourceController 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 common.ConsulTenancyConfig }
ConsulResourceController is a generic controller that is used to reconcile all Consul Resource types, e.g. TrafficPermissions, ProxyConfiguration, etc., since they share the same reconcile behaviour.
func (*ConsulResourceController) ReconcileResource ¶
func (r *ConsulResourceController) ReconcileResource(ctx context.Context, crdCtrl ResourceController, req ctrl.Request, resource common.ConsulResource) (ctrl.Result, error)
ReconcileResource 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 ExportedServicesController ¶
type ExportedServicesController struct { client.Client Log logr.Logger Scheme *runtime.Scheme Controller *ConsulResourceController GatewayConfig gateways.GatewayConfig }
ExportedServicesController reconciles a MeshGateway 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 GRPCRouteController ¶
type GRPCRouteController struct { client.Client Log logr.Logger Scheme *runtime.Scheme Controller *ConsulResourceController }
GRPCRouteController reconciles a GRPCRoute object.
func (*GRPCRouteController) Logger ¶
func (r *GRPCRouteController) Logger(name types.NamespacedName) logr.Logger
func (*GRPCRouteController) SetupWithManager ¶
func (r *GRPCRouteController) SetupWithManager(mgr ctrl.Manager) error
func (*GRPCRouteController) UpdateStatus ¶
func (r *GRPCRouteController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
type GatewayClassConfigController ¶
type GatewayClassConfigController struct { client.Client Log logr.Logger Scheme *runtime.Scheme Controller *ConsulResourceController }
GatewayClassConfigController reconciles a GatewayClassConfig object.
func (*GatewayClassConfigController) Logger ¶
func (r *GatewayClassConfigController) Logger(name types.NamespacedName) logr.Logger
func (*GatewayClassConfigController) SetupWithManager ¶
func (r *GatewayClassConfigController) SetupWithManager(mgr ctrl.Manager) error
func (*GatewayClassConfigController) UpdateStatus ¶
func (r *GatewayClassConfigController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
type GatewayClassController ¶
type GatewayClassController struct { client.Client Log logr.Logger Scheme *runtime.Scheme Controller *ConsulResourceController }
GatewayClassController reconciles a MeshGateway object.
func (*GatewayClassController) Logger ¶
func (r *GatewayClassController) Logger(name types.NamespacedName) logr.Logger
func (*GatewayClassController) SetupWithManager ¶
func (r *GatewayClassController) SetupWithManager(mgr ctrl.Manager) error
func (*GatewayClassController) UpdateStatus ¶
func (r *GatewayClassController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
type HTTPRouteController ¶
type HTTPRouteController struct { client.Client Log logr.Logger Scheme *runtime.Scheme Controller *ConsulResourceController }
HTTPRouteController reconciles a HTTPRoute object.
func (*HTTPRouteController) Logger ¶
func (r *HTTPRouteController) Logger(name types.NamespacedName) logr.Logger
func (*HTTPRouteController) SetupWithManager ¶
func (r *HTTPRouteController) SetupWithManager(mgr ctrl.Manager) error
func (*HTTPRouteController) UpdateStatus ¶
func (r *HTTPRouteController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
type MeshConfigurationController ¶
type MeshConfigurationController struct { client.Client Log logr.Logger Scheme *runtime.Scheme Controller *ConsulResourceController }
MeshConfigurationController reconciles a MeshConfiguration object.
func (*MeshConfigurationController) Logger ¶
func (r *MeshConfigurationController) Logger(name types.NamespacedName) logr.Logger
func (*MeshConfigurationController) SetupWithManager ¶
func (r *MeshConfigurationController) SetupWithManager(mgr ctrl.Manager) error
func (*MeshConfigurationController) UpdateStatus ¶
func (r *MeshConfigurationController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
type MeshGatewayController ¶
type MeshGatewayController struct { client.Client Log logr.Logger Scheme *runtime.Scheme Controller *ConsulResourceController GatewayConfig gateways.GatewayConfig }
MeshGatewayController reconciles a MeshGateway object.
func (*MeshGatewayController) Logger ¶
func (r *MeshGatewayController) Logger(name types.NamespacedName) logr.Logger
func (*MeshGatewayController) SetupWithManager ¶
func (r *MeshGatewayController) SetupWithManager(mgr ctrl.Manager) error
func (*MeshGatewayController) UpdateStatus ¶
func (r *MeshGatewayController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
type ProxyConfigurationController ¶
type ProxyConfigurationController struct { client.Client Log logr.Logger Scheme *runtime.Scheme Controller *ConsulResourceController }
ProxyConfigurationController reconciles a ProxyConfiguration object.
func (*ProxyConfigurationController) Logger ¶
func (r *ProxyConfigurationController) Logger(name types.NamespacedName) logr.Logger
func (*ProxyConfigurationController) SetupWithManager ¶
func (r *ProxyConfigurationController) SetupWithManager(mgr ctrl.Manager) error
func (*ProxyConfigurationController) UpdateStatus ¶
func (r *ProxyConfigurationController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
type ResourceController ¶
type ResourceController 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.SubResourceUpdateOption) error // Get retrieves an object 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 }
ResourceController is implemented by resources syncing Consul Resources from their CRD counterparts. It is used by ConsulResourceController to abstract CRD-specific Consul Resources.
type TCPRouteController ¶
type TCPRouteController struct { client.Client Log logr.Logger Scheme *runtime.Scheme Controller *ConsulResourceController }
TCPRouteController reconciles a TCPRoute object.
func (*TCPRouteController) Logger ¶
func (r *TCPRouteController) Logger(name types.NamespacedName) logr.Logger
func (*TCPRouteController) SetupWithManager ¶
func (r *TCPRouteController) SetupWithManager(mgr ctrl.Manager) error
func (*TCPRouteController) UpdateStatus ¶
func (r *TCPRouteController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
type TrafficPermissionsController ¶
type TrafficPermissionsController struct { client.Client Log logr.Logger Scheme *runtime.Scheme Controller *ConsulResourceController }
TrafficPermissionsController reconciles a TrafficPermissions object.
func (*TrafficPermissionsController) Logger ¶
func (r *TrafficPermissionsController) Logger(name types.NamespacedName) logr.Logger
func (*TrafficPermissionsController) SetupWithManager ¶
func (r *TrafficPermissionsController) SetupWithManager(mgr ctrl.Manager) error
func (*TrafficPermissionsController) UpdateStatus ¶
func (r *TrafficPermissionsController) UpdateStatus(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error
Source Files ¶
- api-gateway-controller.go
- consul_resource_controller.go
- exported_services_controller.go
- gateway_class_config_controller.go
- gateway_class_controller.go
- gateway_controller_crud.go
- gateway_controller_setup.go
- gateway_indices.go
- grpc_route_controller.go
- http_route_controller.go
- mesh_configuration_controller.go
- mesh_gateway_controller.go
- proxy_configuration_controller.go
- tcp_route_controller.go
- traffic_permissions_controller.go