Documentation
¶
Index ¶
- type Config
- type ServiceReconciler
- func (r *ServiceReconciler) AnnotationExpose() string
- func (r *ServiceReconciler) AnnotationGateway() string
- func (r *ServiceReconciler) AnnotationGatewayNamespace() string
- func (r *ServiceReconciler) AnnotationHostname() string
- func (r *ServiceReconciler) AnnotationPort() string
- func (r *ServiceReconciler) FinalizerHTTPRoute() string
- func (r *ServiceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ServiceReconciler) SetupWithManager(mgr ctrl.Manager) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.3.6
type Config struct {
// AnnotationPrefix is the domain prefix for all annotations (e.g., "httproute.controller")
AnnotationPrefix string
// DefaultGateway is the default gateway name when not specified in annotations
DefaultGateway string
// DefaultGatewayNamespace is the default gateway namespace when not specified in annotations
DefaultGatewayNamespace string
// DefaultSectionName is the default gateway listener section name (e.g., "https")
DefaultSectionName string
}
Config holds the controller configuration
func DefaultConfig ¶ added in v0.3.6
func DefaultConfig() Config
DefaultConfig returns the default configuration
type ServiceReconciler ¶
ServiceReconciler reconciles a Service object
func (*ServiceReconciler) AnnotationExpose ¶ added in v0.3.6
func (r *ServiceReconciler) AnnotationExpose() string
AnnotationExpose returns the expose annotation key
func (*ServiceReconciler) AnnotationGateway ¶ added in v0.3.6
func (r *ServiceReconciler) AnnotationGateway() string
AnnotationGateway returns the gateway annotation key
func (*ServiceReconciler) AnnotationGatewayNamespace ¶ added in v0.3.6
func (r *ServiceReconciler) AnnotationGatewayNamespace() string
AnnotationGatewayNamespace returns the gateway-namespace annotation key
func (*ServiceReconciler) AnnotationHostname ¶ added in v0.3.6
func (r *ServiceReconciler) AnnotationHostname() string
AnnotationHostname returns the hostname annotation key
func (*ServiceReconciler) AnnotationPort ¶ added in v0.3.6
func (r *ServiceReconciler) AnnotationPort() string
AnnotationPort returns the port annotation key
func (*ServiceReconciler) FinalizerHTTPRoute ¶ added in v0.3.6
func (r *ServiceReconciler) FinalizerHTTPRoute() string
FinalizerHTTPRoute returns the finalizer name
func (*ServiceReconciler) Reconcile ¶
Reconcile implements the reconciliation loop for Service resources. It watches Services with the expose annotation and creates/updates/deletes corresponding HTTPRoute and ReferenceGrant resources.
The reconciler follows modern Kubernetes controller best practices: - Level-based triggers (reconciles full state, not just events) - Idempotent operations (safe to call multiple times) - Finalizers for cross-namespace resource cleanup (HTTPRoute) - OwnerReferences for same-namespace resources (ReferenceGrant) - Cross-namespace resource management via ReferenceGrant
func (*ServiceReconciler) SetupWithManager ¶
func (r *ServiceReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager. Watches Services and owns ReferenceGrant resources. HTTPRoute is NOT owned via OwnerReferences (cross-namespace not supported). Instead, finalizers on Service ensure cleanup of HTTPRoute on deletion. Uses modern controller-runtime patterns: - For() watches the primary resource (Service) - Owns() watches secondary resources for changes (triggers reconciliation of owner)